A

Admin • 828.03K 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

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.