Java OCA OCP Practice Question 1537

Question

Fill in the blanks:

___ allow Java to support multiple inheritance,

and anonymous inner classes can ___ of them.

  • A. Abstract classes, extend at most one
  • B. Abstract classes, extend any number
  • C. Interfaces, implement at most one
  • D. Interfaces, implement any number


C.

Note

Interfaces allow Java to support multiple inheritance because a class may implement any number of interfaces.

An anonymous inner class may implement at most one interface,

since it does not have a class definition to implement any others.

Option C is the correct answer.




PreviousNext

Related