[Solved] The Object class is the parent class of all the classes in java by default
Basically, you are confused between reference type and instance (object) type. In your program, o is the reference variable with type Object, so o will be able to access only the methods and variables from Object class. Also, t is the reference variable with type test2, so t can access class members of test2. You … Read more