33.8k views
0 votes
The concept of multiple inheritance is implemented in Java by

I. Extending two or more classes.
II. Extending one class and implementing one or more interfaces.
III. Implementing two or more interfaces.
(a) Only (II)
(b) (I) and (II)
(c) (II) and (III)
(d) Only (I)
(e) Only (III).

User Jooyoun
by
7.9k points

1 Answer

6 votes

Final answer:

In Java, multiple inheritance is simulated by extending a single class while implementing one or more interfaces or just implementing multiple interfaces, but it does not support extending multiple classes. The correct answer is (c) (II) and (III).

Step-by-step explanation:

The concept of multiple inheritance in Java can be implemented in the following way:

  • Extending one class and implementing one or more interfaces.
  • Implementing two or more interfaces.

Java does not support extending multiple classes, which would be true multiple inheritance. Therefore, option (I) is incorrect. Java allows a class to extend only one other class but can implement multiple interfaces, which allows for the capability similar to multiple inheritance. The correct answer to the question is (c) (II) and (III).

User Arvind Sisara
by
7.6k points