ProgrammingEasyHCL · Tech Mahindra pattern
Every Java class that declares no superclass implicitly extends:
- A. java.lang.System
- B. Nothing
- C. java.lang.Class
- 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
- In C++, members of a class declared without any access specifier are:
- Which statement about Java String objects is correct?
- What is printed? java String s = "ab"; s.concat("cd"); s.toUpperCase(); System.out.print(s);
- Which pairing is correct?
- Which of these operators cannot be overloaded in C++?
- A variable declared inside a Java interface is implicitly: