·
Given:
abstract final /* Spot 1 */ class Test { /* Spot 2 */ Test(String s){ System.out.println(s); } static /* Spot 3 */ void ocp() { System.out.println("ocp"); } /* Spot 4 */ }
Which statement makes it compile?
- A. Everything already compiles
- B. Delete the 'final' keyword at Spot 1
- C. Put the 'public' modifier at Spot 2
- D. Delete the 'static' keyword at Spot 3
- E. Put an 'abstract/ method at Spot 4
#java #certificationquestion #ocp
A class cannot be 'abstract' and 'final' at the same time.
·ꓭ sᴉ ɹǝʍsuɐ ʇɔǝɹɹoɔ ǝɥꓕ