the Peter Komisar ©
Two new records have been set.
living thing, a bacterium, has been 'resusitated' from
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
an 'int' type to
store the sleep time of the bacterium but you would need a long type to
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
think the article said it was 14 billion kilometers from the sun. If
wanted to hold a
whole number, an int
primitive type wouldn't do it, ( at + / - ~2.1 billion ) . You again
a 'long' type.
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.
second expanded Java course is focused on visual
of Java, including a Inner Classes, a tour of Swing, Event
Layouts, Applets, Graphics and Images.
This course on advanced Java topics
focuses on connectivity.
IO, Java networking, database connections, distributed
Java III Advanced Topics
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.
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.
Also in progress is a course in the MicroEdition
of Java which will include a look at the Blackberry
on the fundamentals of XML and related technologies.
Sun acquired MySQL it is a nice coinicidence to link to
SQL course in progress based on MySQL.
Java Courses ( 1997 -
this section is
added to present additional programming challenges based more on a
approach. These may substitute for the the current set of
Since this is
new this will have to be determined as we proceed.
For starters do
the Planets excercise. If you know 'for loops' from
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
Lab 2 Identifiers and Keywords
You can work on keyword
If you have time, see how many of the keywords
you can pile into a
Lab 3 Class Members
Adapting the student code of
member assignment, create a single student class
that has a constructor that
entering the students name, student's number and
grade point average to be
Student class should have an getAverage method that
prints to consolel the students
ID number and grade point average.
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
you have provided and have their return values
printed to console.
Given an array that contains the set
"TVs", "7", "$400", "CD player", 14, "$200", "VCR",
3, "$300"}, create a program
copies each of the three contained 'records' into it's own
array and then prints the
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
Overriding Create a class
called Heavenly_Body defining a method getStats( ). Extend
the class for each of the Sun, Moon
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
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
sorts it in ascending and descending order. Two new
arrays should be created
receive the result of the algorithm. Each of the algorithms
would be housed in their own
which would take and array as an argument and
return a sorted array as their
ext areas was
more suitable than the original
| Java Intro &
Both Intro and Advanced
now posted on the markboard.
Note the markboard works
in Netscape but the text areas doesn't display in Explorer
with a main() method. Adapt RadiobuttonPanel class to select between
ages 0 to
decade increments and add it the the JFrame. Compile and run.
of SwingCodeExhibit, show four different classes from the second half
JFrame.Change the borders on all or at least one component displayed in
classes.Create three similar JFrame classes and add components to
each of the following LayoutManagers. 1) BorderLayout 2) Flow
& 4) BoxLayout
Set a menubar. (Borrow from tutorial) . Create a row of buttons with
and each with a icon of a related theme. Add a second set of buttons
associazted with the GridBag layout note.
containing four components each demonstrating a variation on event
(Explicit Event Enabling is optional) Try to demonstate the use of
types. ( ie. action, mouse & text ) AND / OR
swing event type while processing the events associated with a
Architecture. (refer to the 2nd jGuru Swing tutorial)
appropriate source and destination objects and use
& FileWriter (in conjunction with BufferedReader and BufferedWriter)
ByteArrayInputStream & ByteArrayOutputStream [or optionally
and 3)DataInputStream and DataOutputStream (in conjunction with
and FileOutputStream) to stream some data you have created between
should show the before and after conditions of the destination object.
client and server which communicate over port 7777 on your local
a P.I.N number , the server verifies if they belong in association. If
returns to the client the funds that are available. For the
of the excercise
available can be an arbitrary fixed value set for each individual
listed on the server.
for a table called World of three rows and three columns Fill with
JDBC and Access, create this table then access one of it's
rows and print it's
screen. Use JDBC code from any resource available to you, in texts or
DSN is a
microsoft uses to associate a url element to a file. Once you have made
Access. Save it. Then go into Windows/System/ and run ODBCad32.exe
DSN and ADD to associate a DSN with your file. This DSN is what
Java program where myDSN is located. This will allow you to access the
sample provided, create an RMI client server that randomly returns to
the day will be a bear or bull market.
1500 threads run the testPrime program. Increase the thread
higher numbers to be checked for prime to find the lab PC's
server class you built in Lab V, adapt it to become a multithreaded
wait( )/ notify( ) program uses the non-static synchronized
class. Each time the musket class is instantiated each user has
and fire. To write an Artillery class where a single cannon is
gunners, the code will have to be modified. The cannon's will have to
static method or block which several threads will call. You might
and and Firer threads responsible for specialized actions all
the static cannon representation..
model derived in Q3 using piped streams.
unfinished code example, the notes and the Client and Server classes
Roberts provided at the end of the code example. write a vote polling
Electorate. Make the third party Ross Perot. In this model casting a
a call to the method representing the chosen party. A static
incremented each time the party method is called providing a
of votes for each party as the election proceeds.
For starters, download the BDK and use it to create a program which uses
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
other a target. A change in property of the control bean changes
visibly in the target.