Name
java.lang.Object
Synopsis
This class is a slightly smaller counterpart to the J2SE
Object class. It forms the base of the object
hierarchy in Java; in other words, all classes are subclasses of
Object. The equals() method
tests for a byte-for-byte equivalence between the data of two
objects. (Be sure not to confuse this with the ==
operator, which simply tests if two references point to the same
object.) getClass() returns a
Class object associated with this object. The
three wait() methods, as well as
notify() and notifyAll(), are
used for thread synchronization on an object. As with any J2SE
object, subclasses should override toString() and
hashCode() if appropriate (e.g., creating an
object that acts as a key in a Hashtable).
Finally, note that the finalize() method has been
eliminated in the J2ME version of Object.
public classObject{ // public constructor publicObject(); // public instance methods public booleanequals(Object obj); public final ClassgetClass(); public inthashCode(); public final voidnotify(); public final voidnotifyAll(); public StringtoString(); public final voidwait() throws java.lang.InterruptedException; public final voidwait(long timeout) throws java.lang.InterruptedException; public final voidwait(long timeout, int nanos) throws java.lang.InterruptedException; }
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access