A

Admin • 828.03K Points
Coach

Q. What is the main purpose of using enums in Java?

  • (A) To define a class
  • (B) To create multiple instances of a method
  • (C) To define a set of named constants
  • (D) To handle runtime exceptions
  • Correct Answer - Option(C)
  • Views: 12
  • Filed under category Java
  • Hashtags: Java Enums

Explanation by: Admin
Enums are used to define a fixed set of named constants in Java, making code more readable and type-safe.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.