Basic HTML version of Foils prepared 18 May 97

Foil 13 The Overarching Object Class

From Java Tutorial - Spring 1997 Part 4: Multithreading, useful Java classes, I/O, Networking, and the future Peking Tutorial, Web Certificate -- Spring-Summer 1997. by Nancy J. McCracken,Geoffrey C. Fox


1 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 any class) can use methods of Object
2 Methods of Object (used as object.Method()) include:
3 clone() Creates a clone of the object
4 equals(another object) compares two objects returning boolean answer
5 getClass() returns a descriptor of type Class (a child of Object) defining class of object
6 toString() returns a String which represents "value" of object. It is expected that each subclass will override this method
7 wait() in various forms is used to cause threads to wait
8 finalize() contains code to perform when object is deleted by system (I.e. garbage collected)

in Table To:


© 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 Thu Jan 8 1998