A

Admin • 830.13K Points
Coach

Q. What does the `name()` method of an enum return?

  • (A) The ordinal position
  • (B) The enum class name
  • (C) The name of the constant as a string
  • (D) The default value of the enum
  • Correct Answer - Option(C)
  • Views: 11
  • Filed under category Java
  • Hashtags: Java Enums

Explanation by: Admin
The `name()` method returns the exact name of the enum constant as declared.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.