Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Core Java - Interview Questions and Answers for 'Multiple inheritence' - 2 question(s) found - Order By Newest | ||||
| ||||
Ans. Java doesn't support multiple inheritance. Interfaces does't facilitate inheritance and hence implementation of multiple interfaces doesn't make multiple inheritance. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oop   oop concepts   inheritence   multiple inheritence   basic interview question Asked in 10 Companies basic   frequent | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. class A { void test() { System.out.println("test() method"); } } class B { void test() { System.out.println("test() method"); } } Suppose if Java allows multiple inheritance like this, class C extends A, B { } A and B test() methods are inheriting to C class. So which test() method C class will take? As A & B class test() methods are different , So here we would Facing Ambiguity. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   inheritence   multiple inheritence Asked in 1 Companies basic   frequent | ||||
Related Questions | ||||
What are points to consider in terms of access modifier when we are overriding any method? | ||||
Why every object constructor automatically call super() in Object before its own constructors? | ||||
How compiler handles the exceptions in overriding ? | ||||
what is covariant return type? | ||||
Are constructors inherited? Can a subclass call the parent's class constructor? When? | ||||
Difference Between this() and super() ? | ||||
Can we reduce the visibility of the inherited or overridden method ? | ||||
Does a class inherit the constructor of its super class? | ||||