Tom Kelliher, CS 116
Sept. 18, 2002
Lab 3 write-up, source code, and postlab due Friday, beginning of class.
Quiz at beginning of class.
Re-read Ch. 4, prepare for Friday's lab (look over on web site).
Finished-up Lab 3.
Lab 4.
The class constructor is of the same name as the class. The arguments to the constructor should be the properties which differ for objects in the class. You declare the types of the arguments in the constructor definition:
ClassName ( argType argName, ... ) { ... // initialize an object of this class type. // This is executed once when the object is created }User defined classes are used exactly the same way as any other class.
setLayout()
method for
containers to do this.