How many methods are in Object class .
Object class is super class of all java class . This means all java class extends Objects
class . So it is important to know about the object class. These are methods
available in java object class.
Java Object Class Methods
1) protected Object clone( )
This method creates and returns a copy of this object.
2) boolean equqls(Object obj)
This method indicates whether some other object is "equal to" this one.
3) protected void finalize()
This method is called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
This method returns the runtime class of this Object.
This method returns a hash code value for the object.
6) void notify()
This method wakes up a single thread that is waiting on this object's monitor.
7) void notifyAll()
This method wakes up all threads that are waiting on this object's monitor.
8) String toString()
This method returns a string representation of the object.The java toString() method is used when we need a string representation of an object
9) Void wait()
This method causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.
11) void wait(long timeout , int nanos)
How many methods are in Object class .
Reviewed by Mukesh Jha
on
10:35 PM
Rating:
No comments:
Add your comment