A

Admin • 828.43K Points
Coach

Q. How do you define custom fields for enum constants?

  • (A) By using static variables only
  • (B) By passing parameters to the enum constructor
  • (C) By overriding the enum class
  • (D) You can't define fields in enums
  • Correct Answer - Option(B)
  • Views: 11
  • Filed under category Java
  • Hashtags: Java Enums

Explanation by: Admin
You can pass parameters to an enum constructor and store them in fields.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.