April 27
Examples from April 29
Today we worked with two simple programs that use the Comparable
interface to facilitate sorting. Both call predefined
methods to sort structures whose base types are in class Person, which implements
Comparable:
Person.java PersonList.java does this with LinkedLists
Person.java PersonArray.java does this with arrays.
Then we did a first example of subclasses. Class Point is a simple class; Class ColoredPoint is a subclass of Point:
Point.java ColoredPoint.java PointApplication.java