Java OCA OCP Practice Question 1256

Question

Which of the following statements about inheritance is correct?

  • A. Java does not support multiple inheritance.
  • B. Java allows multiple inheritance using abstract classes.
  • C. Java allows multiple inheritance using non-abstract classes.
  • D. Java allows multiple inheritance using interfaces.


D.

Note

While Java does not allow a class to extend more than one class, it does allow a class to implement any number of interfaces.

Multiple inheritance is, therefore, only allowed via interfaces, making Option D the correct answer.




PreviousNext

Related