A

Admin • 832.27K Points
Coach

Q. Can enums be declared inside a class in Java?

  • (A) Yes, only if the class is static
  • (B) Yes, both static and non-static classes
  • (C) No, enums must be top-level only
  • (D) Only inside abstract classes
  • Correct Answer - Option(B)
  • Views: 18
  • Filed under category Java
  • Hashtags: Java Enums

Explanation by: Admin

Enums can be declared as static types inside both static and non-static classes.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.