1. public interface Status { 12. /* insert code here */ int MY_VALUE = 10; 13. } Which three are valid on line 12? (Choose three.)
  1. A. final

  2. C. native

  3. F. abstract

  4. G. protected


Correct Option: A

AI Explanation

To answer this question, we need to understand the different modifiers that can be used in a Java interface.

In a Java interface, the following modifiers can be used:

A) final: This modifier indicates that the value of the variable cannot be changed once it is assigned. It is valid to use the final modifier in an interface variable declaration. Therefore, option A is valid.

B) native: This modifier is used to indicate that a method is implemented in a language other than Java. It is not valid to use the native modifier in an interface variable declaration.

C) abstract: This modifier is used to indicate that a method or class does not have an implementation and must be implemented by a subclass. It is not valid to use the abstract modifier in an interface variable declaration.

D) protected: This modifier is used to indicate that a variable, method, or class can only be accessed within its own package or by a subclass of its class. It is not valid to use the protected modifier in an interface variable declaration.

Therefore, the three valid modifiers to use on line 12 are final.

Find more quizzes: