Java OCA OCP Practice Question 848

Question

Consider the following variable declaration within the definition of an interface:

int i = 10; 

Which of the following declarations defined in a non-abstract class, is equivalent to the above?

Select 1 option

  • A. public static int i = 10;
  • B. public final int i = 10;
  • C. public static final int i = 10;
  • D. public int i = 10;
  • E. final int i = 10;


Correct Option is  : C

Note

Fields in an interface are implicitly public, static and final.




PreviousNext

Related