Two new records have been set.
The oldest
living thing, a bacterium, has been 'resusitated' from
a
250 million year
old sleep. Also, a big bang has been observed from
the farthest point ever
observed. The light has
been travelling for 11 billion years to reach
earth. In Java you could
use
an 'int' type to
store the sleep time of the bacterium but you would need a long type to
store
the
light years from
the gamma burst. (A float or a double would store the travel
time too but as
floating point rather than integral numbers.)
A new planet,
informally named Xena, has been discovered. It is further away than
Pluto and
larger. I
think the article said it was 14 billion kilometers from the sun. If
you
wanted to hold a
whole number, an int
primitive type wouldn't do it, ( at + / - ~2.1 billion ) . You again
would
need
a 'long' type.
Preamble
Far below is the original pages used in the first Java Courses offered
in the late 90s at Conestoga College in Kitchener-Waterloo. They
are left intact below. They are brief and to the point. They have been
eclipsed by my newer notes which are linked below.
A revamped Java Intro course focused on fundamentals continues
to be iterated and filtered. Order of topics sometime change.
Java Fundamentals
http://www.sentex.net/~pkomisar/java1.html
The second expanded Java course is focused on visual aspects
of Java, including a Inner Classes, a tour of Swing, Event handling
Layouts, Applets, Graphics and Images.
Visual Java
http://www.sentex.net/~pkomisar/java2.html
This course on advanced Java topics focuses on connectivity.
IO, Java networking, database connections, distributed
applications etc.
Java III Advanced Topics
http://www.sentex.net/~pkomisar/java3.html
Enterprise Java
A course on Enterprise Topics has been completed. It
was based on using IBM's RAD 7. RAD 7 is expensive
to licence so this course will be refocused on using
RAD 7's core program Eclipse.
http://www.sentex.net/~pkomisar/java4.html
Enterprise Java: Take 2
In this take of the course which is in progress, we are
stripping away Rational Developer using standard
Enterprise Eclipse. We are also building our own
simple examples as we go. This should provide a
simplified view of the enterprise architecture.
http://www.sentex.net/~pkomisar/javaEE.html
Wireless Java
Also in progress is a course in the MicroEdition
of Java which will include a look at the Blackberry
API.
http://www.sentex.net/~pkomisar/jwire.html
A course on the fundamentals of XML and related technologies.
XML
http://www.sentex.net/~pkomisar/XML.html
Java Web Services
http://www.sentex.net/~pkomisar/webservices.html
MySQL
Since Sun acquired MySQL it is a nice coinicidence to link to
a SQL course in progress based on MySQL.
http://www.sentex.net/~pkomisar/sql.html
Java Courses ( 1997 - 2001 )
Intro Lab
// this section is added to present additional programming challenges based more on a
problem solving approach. These may substitute for the the current set of assignments.
Since this is new this will have to be determined as we proceed.
Lab1 Orientation
For starters do the Planets excercise. If you know 'for loops' from another language
such as C, they are essentially the same in Java. Use a for loop to print out each planet
and the number of moons each planet has. You'll have to find the astronomical
information somewhere.
Lab 2 Identifiers and Keywords
You can work on keyword assignments. If you have time, see how many of the keywords
you can pile into a single program.
Lab 3 Class Members
Adapting the student code of the class member assignment, create a single student class
that has a constructor that allows entering the students name, student's number and
grade point average to be entered. Student class should have an getAverage method that
prints to consolel the students name, ID number and grade point average.
OR
Create a class that has 4 methods each operational and returning a different type and
each taking different types and numbers of parameters. In your class these methods should
be called on suitalbe variable values you have provided and have their return values
printed to console.
Arrays
Given an array that contains the set { "TVs", "7", "$400", "CD player", 14, "$200", "VCR",
3, "$300"}, create a program that copies each of the three contained 'records' into it's own
array and then prints the subarrays contents to screen.
Vector Use the above array or make a new one and transfer the contents to a Vector and
back to another array. Print to console the contents of each container before and after
each transfer.
Overriding Create a class called Heavenly_Body defining a method getStats( ). Extend
the class for each of the Sun, Moon and the Earth. Override the getStats( ) method in each
case to return to console the contents of a Vector describing the size (any relevant dimension),
mean surface temperature and type of atmosphere for each heavenly body. (We can make
up all this data or find it on the web).
Lab Control and Math class
The Math class and control statements provide the tools to create sorting algorithms.
Create a class a takes an array and sorts it in ascending and descending order. Two new
arrays should be created to receive the result of the algorithm. Each of the algorithms
would be housed in their own methods which would take and array as an argument and
return a sorted array as their return value.
ext areas was
J1 Java Intro Note Board J2 Java Advanced Java Intro & Advanced Both Intro and Advanced marks are now posted on the markboard.
Peter
Note the markboard works in Netscape but the text areas doesn't display in Explorermore suitable than the original suggestion. .
Intro & Advanced Final Course Marks The Mark Board
Supplemental Topics An Abridged Java Language Specification Security Enterprise Java Beans
Advanced Lab Lab Swing 1
Create a JFrame with a main() method. Adapt RadiobuttonPanel class to select between
ages 0 to 70 in decade increments and add it the the JFrame. Compile and run.Lab Swing II
In the fashion of SwingCodeExhibit, show four different classes from the second half of the
tutorial in a JFrame.Change the borders on all or at least one component displayed in each
of these classes.Create three similar JFrame classes and add components to demonstrate
the behaviour of each of the following LayoutManagers. 1) BorderLayout 2) Flow Layout
3) GridLayout & 4) BoxLayout
OR
Create a JFrame. Set a menubar. (Borrow from tutorial) . Create a row of buttons with
Empty borders and each with a icon of a related theme. Add a second set of buttons using
the code that is associazted with the GridBag layout note.Lab III Events
Create a JFrame containing four components each demonstrating a variation on event
processing (Explicit Event Enabling is optional) Try to demonstate the use of three
different event types. ( ie. action, mouse & text ) AND / OR
Excercise a swing event type while processing the events associated with a JComponent's
Model View Controller Architecture. (refer to the 2nd jGuru Swing tutorial)Lab IV
Create appropriate source and destination objects and use
1) FileReader & FileWriter (in conjunction with BufferedReader and BufferedWriter)
2) ByteArrayInputStream & ByteArrayOutputStream [or optionally ObjectInputStream &
ObjectOutputStream] and 3)DataInputStream and DataOutputStream (in conjunction with
FileInputStream and FileOutputStream) to stream some data you have created between them.
Your program(s) should show the before and after conditions of the destination object.Lab V
Write a simple client and server which communicate over port 7777 on your local machine.
Given a name and a P.I.N number , the server verifies if they belong in association. If they do,
the server returns to the client the funds that are available. For the purpose of the excercise
the funds available can be an arbitrary fixed value set for each individual listed on the server.Lab VI
Write the SQL for a table called World of three rows and three columns Fill with arbitrary
values.Using JDBC and Access, create this table then access one of it's rows and print it's
values to screen. Use JDBC code from any resource available to you, in texts or online, to
achieve the objective.
DSN is a handle microsoft uses to associate a url element to a file. Once you have made a
database file in Access. Save it. Then go into Windows/System/ and run ODBCad32.exe
Press on System DSN and ADD to associate a DSN with your file. This DSN is what will
appear in the Java program where myDSN is located. This will allow you to access the
database via jdbc.Lab VII
Using the RMI sample provided, create an RMI client server that randomly returns to the
client whether the day will be a bear or bull market.Lab VIII
1) Starting at 1500 threads run the testPrime program. Increase the thread number
by trying higher numbers to be checked for prime to find the lab PC's carrying
limit.
2) Using the server class you built in Lab V, adapt it to become a multithreaded server.
3) The sample wait( )/ notify( ) program uses the non-static synchronized methods
of the Musket class. Each time the musket class is instantiated each user has his
own arm to load and fire. To write an Artillery class where a single cannon is used
by several gunners, the code will have to be modified. The cannon's will have to be
housed in a static method or block which several threads will call. You might write
Loader threads and and Firer threads responsible for specialized actions all
synched to the static cannon representation..
4) Implement the model derived in Q3 using piped streams.Lab IX
Using the unfinished code example, the notes and the Client and Server classes from
Heller & Roberts provided at the end of the code example. write a vote polling system
for the American Electorate. Make the third party Ross Perot. In this model casting a
vote is done by a call to the method representing the chosen party. A static variable
is automatically incremented each time the party method is called providing a
running talley of votes for each party as the election proceeds.Lab X For starters, download the BDK and use it to create a program which uses
a button to stop and start the java juggler. Consider what code this visual technique replaces.
The code challenge is to write two original beans where one is a control
bean and the other a target. A change in property of the control bean changes
something visibly in the target.
.