Declarations and Access Control - Programming

Q1:

Which is a valid declaration within an interface?

A public static short stop = 23;

B protected short stop = 23;

C transient short stop = 23;

D final void madness(short stop);

ANS:A - public static short stop = 23;

(A) is valid interface declarations. (B) and (C) are incorrect because interface variables cannot be either protected or transient. (D) is incorrect because interface methods cannot be final or static.