Java OCA OCP Practice Question 1553

Question

Fill in the blanks:

A(n) ___ and a(n) ___ can define static methods.

  • A. abstract class, local inner class
  • B. anonymous inner class, interface
  • C. member inner class, enum
  • D. enum, static inner class


D.

Note

An enum and static inner class can define static methods, making Option D the correct answer.

Options A, B, and C are incorrect because the other types of inner classes cannot define static methods.

Note that interfaces and abstract classes can define static methods.




PreviousNext

Related