Point No. 1

Object class is the super most class available in the Java language.

Point No. 2

If any class or any interface is available in the java.lang package we dont have to import it. Straight away we can use it. Object class is also available in the java.lang package so we dont have to import it explicitly.

Point No. 3

The most commonly used and required general-purpose classes and interfaces in Java programming are grouped into a package known as "java.lang". All the classes and interfaces available in this package are automatically accessible to any Java program without needing to import them explicitly.

Point No. 4

There is no chance of writing even a single runnable Java program without using a member of "java.lang" package.

Point No. 5

The most commonly required methods for all the classes are available in the object class.

Point No. 6

All the classes whether they are user defined or inbuilt, all are sub classes to the Object class, whether directly or indirectly. In other words all the classes are inheriting from the Object class.

class A extends Object
{
}
          

Point No. 7

Totally 12 methods are available in Object class.

  1. protected Object clone()
  2. boolean equals(Object obj)
  3. protected void finalize()
  4. Class getClass()
  5. int hashCode()
  6. void notify()
  7. void notifyAll()
  8. String toString()
  9. void wait()
  10. void wait(long timeout)
  11. void wait(long timeout, int nanos)
  12. private static native void registerNatives();

Point No. 8

If you are not overriding toString() method of Object class, and if you are trying to print the object referece you will get the Objects memory location address not the content. Ex: class-name@hashCode in the form of hexadecimal A@36baf30c

Point No. 9

Usually we dont worry about the object's memory address instead we need the content of the object.

Point No. 10

In order to get the content of the object instead its address we need to override toString of object class in our class.

Point No. 11

If you try to print the referece of an object then internally it is going to call the toString method and we get the return value.

Point No. 12

In all the wrapper classes, collection classes and in String, String Buffer and String Builder classes toString method got overrided to return the object's content.

Point No. 13

For every object a unique code will be generated by the JVM it is called hashCode.

Point No. 14

hashcode does not represent address of object, JVM will use this hashcode while saving objects into hashing related datastructures like hashtable, hashMap, hashSet etc.

Point No. 15

The main advantage of saving objects based on hashcode is search operation will become easy. (the most powerful and popular algorith is hashing).

Point No. 16

The registerNatives() method in Java was deprecated in Java 9 and removed in Java 17. It was used to register native methods with the JVM. Starting from Java 17, this method is no longer available, and native methods are instead registered using method handles.

Point No. 17

The registerNatives() method in Java was deprecated in Java 9 and removed in Java 17. It was used to register native methods with the JVM. Starting from Java 17, this method is no longer available, and native methods are instead registered using method handles.