Java OCA OCP Practice Question 1247

Question

Which modifier can be applied to an abstract interface method?

  • A. protected
  • B. static
  • C. final
  • D. public


D.

Note

All abstract interface methods are implicitly public, making Option D the correct answer.

Option A is incorrect because protected conflicts with the implicit public modifier.

Since static methods must have a body and abstract methods cannot have a body, Option B is incorrect.

Option C is incorrect.

A method, whether it be in an interface or a class, cannot be declared both final and abstract, as doing so would prevent it from ever being implemented.




PreviousNext

Related