Open In App
Related Articles

Java | Inheritance | Question 7

Improve Article
Improve
Save Article
Save
Like Article
Like

Which of the following is true about inheritance in Java.

1) In Java all classes inherit from the Object class directly or indirectly. The Object class is root of all classes.

2) Multiple inheritance is not allowed in Java.

3) Unlike C++, there is nothing like type of inheritance in Java where we can specify whether the inheritance is protected, public or private.

(A) 1, 2 and 3
(B) 1 and 2
(C) 2 and 3
(D) 1 and 3


Answer: (A)

Explanation: See Comparison of Inheritance in C++ and Java

Quiz of this Question

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Similar Reads