what is an object class?Explain its methods?

Answer Posted / srinu

Object class:-
Class Object is the root of the class hierarchy. Every class
has Object as a super class. All objects, including arrays,
implement the methods of this class.

1)protected Object clone()
Creates and returns a copy of this object.
2) boolean equals(Object obj)
Indicates whether some other object is "equal to"
this one.
3)protected void finalize()
Called by the garbage collector on an object when
garbage collection determines that there are no more
references to the object.
4)Class<? extends Object> getClass()
Returns the runtime class of an object.
5) int hashCode()
Returns a hash code value for the object.
6)void notify()
Wakes up a single thread that is waiting on this
object's monitor.
7) void notifyAll()
Wakes up all threads that are waiting on this
object's monitor.
8) String toString()
Returns a string representation of the object.
9)void wait()
Causes current thread to wait until another thread
invokes the notify() method or the notifyAll() method for
this object.
10)void wait(long timeout)
Causes current thread to wait until either another
thread invokes the notify() method or the notifyAll() method
for this object, or a specified amount of time has elapsed.
11) void wait(long timeout, int nanos)
Causes current thread to wait until another thread
invokes the notify() method or the notifyAll() method for
this object, or some other thread interrupts the current
thread, or a certain amount of real time has elapsed.

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a java list?

831


Explain the overview of UDP messaging.

930


What do you mean by JVM?

823


Explain thread life cycle in java?

795


Give me example of derived data types.

857


what is the constructor and how many types of constructors are used in java?

769


From the two, which would be easier to write: synchronization code for ten threads or two threads?

837


What is difference between == equals () and compareto () method?

757


What causes memory leaks in java?

683


What happens if I remove static from main method?

779


What is your platform’s default character encoding?

800


How do you compare characters in java?

744


What is difference between hashset and hashmap?

813


What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

889


What is a file pointer?

728