A

Admin • 828.03K Points
Coach

Q. Which method compares the ordinal values of two enum constants?

  • (A) equals()
  • (B) name()
  • (C) compareTo()
  • (D) ordinal()
  • Correct Answer - Option(C)
  • Views: 11
  • Filed under category Java
  • Hashtags: Java Enums

Explanation by: Admin
The `compareTo()` method compares the ordinal values of two enum constants.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.