- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Method of Object class in Java
Following are various methods of Object class −
- protected Object clone() - Used to create and return a copy of this object.
- boolean equals(Object obj) - Used to indicate whether some other object is "equal to" this one.
- protected void finalize() - garbage collector calls this method on an object when it determines that there are no more references to the object.
- Class<?> getClass() - Used to get the runtime class of this Object.
- int hashCode() - Used to get a hash code value for the object.
- void notify() - Used to wake up a single thread that is waiting on this object's monitor.
- void notifyAll() - Used to wake up all threads that are waiting on this object's monitor.
- String toString() - Used to get a string representation of the object.
- void wait() - marks the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.
- void wait(long timeout) - marks the 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.
- void wait(long timeout, int nanos) - marks the 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.
Advertisements