CS 4773 Object Oriented Systems


I have been asked to talk about the following:


implements Runnable just means that the class has a run method and the class can be passed to a Thread constructor.
The Thread executes the run method of this class rather than its own run method.

We had an example of this in class on January 30 with the AnimationApplet class.


Converting from C to Java

A possible exam question might involve taking a C function and writing a corresponding Java method.
Here are some of the differences you would have to worry about: Luckily we have not yet covered disk I/O.

JOTSA availability

The new version of Jotsa is available in
/usr/local/courses/java/jotsanewbeta
This is a symbolic link to version 0.817.
Soon the symbolic link jotsabeta will point to this instead of to 0.707 which still uses the old interface.
You should be using this one now.

Some of the new features in 0.817 which were not discussed earlier

The following are in JotsaAnimationApplet The following are in JotsaAnimationObject

Synchronization in Java nad JOTSA.

Java supports synchronization through monitors.

Each class is potentially a monitor.

Methods are protected using the key word synchronized. The following methods are used:

Here is an applet that illustrates the use of these concepts.

Recall the classical producer/consumer or bounded buffer problem.


Click Here to run this applet.

This applet illustrates both Java synchronization and several features of JOTSA. Here are the idea of the implementation: