Multiple choice technology programming languages

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

  1. final

  2. public

  3. native

  4. static

Reveal answer Fill a bubble to check yourself
A,B,D Correct answer
Explanation

Interface variables are implicitly public, static, and final. You can explicitly declare these modifiers, and they are valid. The native modifier only applies to methods, not fields.

AI explanation

Interface fields are implicitly public, static, and final, so explicitly writing any of those three modifiers on the declaration is redundant but perfectly legal. native is a modifier for methods (indicating a JNI implementation) and cannot be applied to a field, so it doesn't belong on line 12.