A

Admin • 833K Points
Coach

Q. In which case is the `values()` method available for an enum?

  • (A) Always, as part of java.lang.Enum
  • (B) Only if explicitly defined
  • (C) Available as a compiler-generated static method
  • (D) Never available
  • Correct Answer - Option(C)
  • Views: 30
  • Filed under category Java
  • Hashtags: Java Enums

Explanation by: Admin

The `values()` method is a static method automatically added by the compiler to each enum.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.