Home >Java >javaTutorial >What are the common methods of Object class in Java?

What are the common methods of Object class in Java?

王林
王林forward
2023-04-20 23:25:06864browse

What are the public methods of Object?

  1. clone() Create Bin Return a copy of this object

  2. equals() Determine

  3. getclass() returns the running class of object

  4. hashcode() returns the hash code value of the object

  5. ##notify() wakes up A single process waiting for an object listener

  6. notifyAll() wakes up all processes that are waiting for an object listener

  7. wait() causes the current thread to wait , until another thread calls the object's notify() method or notifyAll() method

  8. ##toString() returns the string representation of this object
  9. finalize() The garbage collector calls this method when the garbage collection determines that the object is not needed

The above is the detailed content of What are the common methods of Object class in Java?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete