Skip to main content
Per comments, linked to Java Language Spec for documentation and mentioned that method is omitted from JavaDoc. Added heading for readability.
Source Link
Basil Bourque
  • 346k
  • 128
  • 949
  • 1.3k

.values()

youYou can docall the following:values() method on your enum.

for (Direction dir : Direction.values()) {
  // do what you want
}

This values() method is implicitly declared by the compiler. So it is not listed on Enum doc.

you can do the following:

for (Direction dir : Direction.values()) {
  // do what you want
}

.values()

You can call the values() method on your enum.

for (Direction dir : Direction.values()) {
  // do what you want
}

This values() method is implicitly declared by the compiler. So it is not listed on Enum doc.

Source Link
notnoop
  • 59.4k
  • 22
  • 126
  • 144

you can do the following:

for (Direction dir : Direction.values()) {
  // do what you want
}