What does `Enum.values()` return?

Java Professional Easy

Java Professional — Easy

What does `Enum.values()` return?

Key points

  • The method `Enum.values()` specifically returns an array.
  • The array contains all enum constants.
  • The order of the constants is based on their declaration.
  • This method simplifies accessing all enum values in a structured manner.

Ready to go further?

Related questions