Java OCA OCP Practice Question 1518

Question

Fill in the blanks:

It is possible to extend an ___ but not an ___.

  • A. interface, abstract class
  • B. abstract class, enum
  • C. enum, interface
  • D. abstract class, interface


B.

Note

An interface can be extended by another interface and a class can be extended by another class, making the second part of Options A, C, and D incorrect.

Option B is correct because an enum cannot be extended.

Option C is also incorrect for this reason.




PreviousNext

Related