Java OCA OCP Practice Question 50

Question

Which of the following are true?

Choose all that apply.

  • A. An enum definition should declare that it extends java.lang.Enum.
  • B. An enum may be subclassed.
  • C. An enum may contain public method definitions.
  • D. An enum may contain private data.


C, D.

Note

Enums may not extend or be extended.

They may contain methods and data like ordinary classes.




PreviousNext

Related