A

Admin • 833.24K Points
Coach

Q. Can you use switch-case with enum in Java?

  • (A) No, enums cannot be used in switch
  • (B) Only with numeric enums
  • (C) Yes, Java supports enums in switch-case
  • (D) Only in Java 8 and above
  • Correct Answer - Option(C)
  • Views: 28
  • Filed under category Java
  • Hashtags: Java Enums

Explanation by: Admin

Enums can be used in switch-case statements, making code more readable.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.