Top

Discussion

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);

Answer: A

(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.

No comment is present. Be the first to comment.
Loading…

Post your comment