ProgrammingEasyHCL · Tech Mahindra pattern

A variable declared inside a Java interface is implicitly:

  1. A. public static final
  2. B. private static
  3. C. public and per-object
  4. D. protected final

Correct answer: A. public static final

Interface fields are constants: public, static and final whether you write those words or not, and they must be initialised where they are declared.

More OOP with C++ and Java questions

Exams that ask this topic