Java OCA OCP Practice Question 534

Question

Which of the following declarations are illegal? (Choose all that apply.)

  • A. default String s;
  • B. transient int i = 41;
  • C. public final static native int w();
  • D. abstract double d;
  • E. abstract final double hyperbolicCosine();


A, D, E.

Note

A is illegal because "default" is not a keyword.

B is a legal transient declaration.

C is strange but legal.

D is illegal because only methods and classes may be abstract.

E is illegal because abstract and final are contradictory.




PreviousNext

Related