Java OCA OCP Practice Question 1055

Question

Which of the following are true?

  • A. A top-level class may be declared as private.
  • B. A method may be declared as transient.
  • C. A constructor may be declared as volatile.
  • D. A local variable may be declared as final.


D.

Note

A local variable may be declared as final.

Only variables may be declared as volatile or final.

Top-level classes may not be private.




PreviousNext

Related