SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:It's added to each enum class automatically, and that's where it shows up. Check out TimeUnit for instance. The static valueOf(string) and values() methods are added to each enum class.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Steve
Steve
Joanne
Dotan Cohen wrote:I do not see that method documented:
http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Enum.html
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Joanne
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Joanne Neal wrote:The values() method is also mentioned in the Oracle tutorial which is a little easier to read than the JLS.
But I still miss the bit about enums in other languages being only glorified integers. I suppose they had to take it out because it annoyed people who like “other languages”!Joanne Neal wrote: . . . Oracle tutorial . . .
Campbell Ritchie wrote:I suppose they had to take it out because it annoyed people who like “other languages”!
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Joanne Neal wrote:Looks like the Javadoc has been updated for Java 7. The values() and valueOf(String) methods are both mentioned in the description of the valueOf(Class<T> , String) method.
Joanne
Joanne Neal wrote:...I think that it should at least be mentioned in the main description rather than buried in another method's description.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here