Abstract:
The following programs are examples of the Java programming language. The first one labeled myFrame.java creates different geometric shapes. It demonstrates the use of built in graphics capabilities of Java. The second program named myCalc.java is an Java calculator applet. It contains all the basic functionality of a calculator as well as scientific functions. It shows how applets are created and how actions are handled in them. The third program named TowerHanoi.java graphically displays the solution for the Towers of Hanoi. This is also a demonstration of the built in graphic capabilities. It provides a graphical interface that allows users to choose the number of disks, select the speed at which the disks move, and allow them to pause the movement and to reset it.The first and third programs are application in the Java language. They will run on a machine that has a Java compiler and is capable of supporting graphics. The second program is an applet. Applets are different from applications in that they are developed to be used on the Internet. They can be run on any browser that supports Java.