- Introduction to JVM Languages
- Vincent van der Leun
- 110字
- 2021-07-02 21:46:28
Important object methods
The most commonly used methods of java.lang.Object are:

One of the more important methods that object (and therefore every other JVM object) offers is the toString() method that returns a textual description of the current object instance. Oracle's default implementation returns the fully qualified class name plus the object's hashCode() result in hexadecimal format, but classes are encouraged to override this method and provide a better readable description of their content.
The equals() and hashCode() methods are used extensively in the Collection API; We'll look at their usage in detail.
Refer to the full API documentation for the list of all the methods of the java.lang.Object class.