Return to site

JAVA CERTIFICATION QUESTION: Enums and implementing interfaces in Java

· java,ocp

Even though an enum cannot use or be the target of an extends clause,

it is possible—in specific and limited situations—to have an enum that is a subclass of another enum.

Given an interface and two enums:

 

Which is true? Choose one.

A. Both enum types fail to compile.

B. The Emotion enum fails to compile.

C. The output is the following:

Good mood, laughing ;-) ;-|

D. The output is the following:

Good mood, laughing GOOD LAUGHING

 

 

 

·ꓛ uoᴉʇdo sᴉ ɹǝʍsuɐ ʇɔǝɹɹoɔ ǝɥꓕ ·uoᴉsnʅɔuoꓛ