ProgrammingEasyHCL · Tech Mahindra pattern

Every Java class that declares no superclass implicitly extends:

  1. A. java.lang.System
  2. B. Nothing
  3. C. java.lang.Class
  4. D. java.lang.Object

Correct answer: D. java.lang.Object

Object is the root of the Java class hierarchy, which is why every object has equals, hashCode and toString.

More OOP with C++ and Java questions

Exams that ask this topic