Difficulty: Easy
Correct Answer: public static short stop = 23;
Explanation:
Introduction / Context:This question checks the rules for declarations inside an interface in Java.
Concept / Approach:Inside interfaces:
Step-by-Step:
Option A: Legal. Interfaces can contain constants (public static final short stop = 23;).Option B: protected not allowed inside interface variables.Option C: transient is not valid for constants.Option D: final void madness(...) is invalid because interface methods cannot be final (they must be overridden unless default/static).Final Answer:public static short stop = 23;
Discussion & Comments