Example Codes in the Java Intro Lecture




0: Hello World Simplest Java program.
1: Basics Array implementation of stack. This is about the basics: classes, objects, methods, arrays, constructors.
2: "Pointers" Linked list implementation of stack. This is about object references (pointers, or the lack thereof), linked list, garbage collection.
3: Libraries This is about using libraries (packages): we reimplement the stack ADT using the "Vector" library.
4: Inheritance This is about object inheritance and class hierarchy.
5: Code Reuse This is about code reuse. The same stack is used to store strings and integers. Note that there are "two flavors" of integers: one is a primitive like the C version; the other is a subclass of an "Object". This example only works for the Object version.
6: Multiple Implementations This is about multiple implementation of the same interface, done using "abstract" classes.
7: Hello World Simplest applet.
8: Applet Life Cycle Basic methods of an applet.
9: Drawing and Events An applet that does some simple drawing and handles mouse events. (Click on the applet to see what it does.)




CS126                               © 1999    Randy Wang