I try to understand what the Object.getClass() method does.
The documentation says that it \"returns the runtime class of an object.\" That explanation
It means "the class of the instance the variable refers to at runtime" (sorry if that's not actually clearer).
If you have a reference to an Object, it could refer to an Object, a String, an Integer... you get that class, not Object.
Object obj1 = new Object();
System.out.println(obj1.getClass()); // java.lang.Object
String obj2 = "";
System.out.println(obj2.getClass()); // java.lang.String
obj1 = obj2;
System.out.println(obj1.getClass()); // java.lang.String, not Object.