D

Dhruva Jagannath • 660 Points
Invincible

Q. What type of method is `values()` in an enum?

  • (A) Static method added by compiler
  • (B) Instance method
  • (C) Method from Enum class
  • (D) Custom method defined by user
  • Correct Answer - Option(A)
  • Views: 13
  • Filed under category Java
  • Hashtags: Java Enums

Explanation by: Dhruva Jagannath
`values()` is a static method automatically added by the compiler.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.