A

Admin • 828.03K Points
Coach

Q. Which method returns the position of an enum constant in its declaration?

  • (A) ordinal()
  • (B) position()
  • (C) index()
  • (D) value()
  • Correct Answer - Option(A)
  • Views: 11
  • Filed under category Java
  • Hashtags: Java Enums

Explanation by: Admin
The `ordinal()` method returns the zero-based position of the enum constant in the enum declaration.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.