• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't find the method values() used for enums.

 
Nikolaos Plastiras
Greenhorn
Posts: 7
Firefox Browser Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to find the static values() method that is used to iterate through enums in J2SE 6 documentation but I can't find it.
Is this the correct class?
public abstract class Enum<E extends Enum<E>> extends Object implements Comparable<E>, Serializable
 
Emanuel Kadziela
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it's not the Enum class, its the enum keyword, like this:

 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The values() method gets generated automatically for all enum classes. You can find it in the specific enum Javadoc page. For example check out TimeUnit.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does get a mention in the Enum javadoc, but not as a separate method, just as an aside in the description of the valueOf method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic