Basic HTML version of Foils prepared 17 Nov 97

Foil 16 The Overarching Object Class

From Java Tutorial, July 1, 1996 CEWES Tutorial, CPS606, JSU Class CSC499 -- July 22-25 1997, Fall 97. by Nancy J. McCracken,Geoffrey C. Fox, Tom Scavo


Public class Object is the root of the class hierarchy. Every Java class has Object as its ultimate parent and so any object (object with a small "o" is any instance of a class) can use methods of Object.
Methods of Object include:
  • clone() creates a clone of the object
  • equals( Object ) compares two objects, returning a boolean result
  • getClass() returns a descriptor of type Class (a child of Object) defining the class of the object
  • toString() returns a String representation of the object. It is expected that each subclass will override this method
  • wait(...) in various forms causes threads to wait
  • finalize() executed when the object is deleted by system (i.e., garbage collected)



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Wed Apr 1 1998