29 Ağustos 2010 Pazar

Object Class

Method Description
clone This protected method, which takes no arguments and returns an Object reference, makes a copy of the object on which it is called. When cloning is required for objects of a class, the class should override method clone as a public method and should implement interface Cloneable (package java.lang).


equals This methods compares two objects for equality and returns true if they are equal and false otherwise. The method takes any Object as an argument. It should returns if the argument is null. It should returns true if an object is compared to itself, as in object1.equals (object1). 
finalizeThis protected method is called by the garbage collector to perform termination housekeeping on an object just before the garbage collector reclaims the object`s memory.
getClass Every object in java knows its own type at execution time. Method getClass returns an object of class Class (package java.lang) that contains information about the object`s type, such as its class name.
hashCode A hashtable is a data structure that relates one object, called the key, to another object, called the value. when initially inserting a value into a hashtable, the key`s hashCode method is called. The hashcode value returned is used by the hashtable to determine the location at which to insert the corresponding value.
notify,waitMethods notify, notifyAll and the three overloaded version of wait are related to multithreading.
toString This methods returns a String representation of an object.

Hiç yorum yok:

Yorum Gönder