A

Admin • 828.43K Points
Coach

Q. Which method is used to get an enum constant by name?

  • (A) fromName()
  • (B) nameOf()
  • (C) get()
  • (D) valueOf()
  • Correct Answer - Option(D)
  • Views: 18
  • Filed under category Java
  • Hashtags: Java Enums

Explanation by: Admin
The `valueOf()` method returns the enum constant with the specified name.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.