Could you point me out to a class, from official Java API that has a good use of enums ?
I could not find any specific class.
Does the Java API incorporates enums in their classes at all?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are 328 enum classes defined in the JRE 7. I suggest you read the Enum Types tutorial
A simple one I have used is java.nio.AccessMode.
An enum worth understanding is Thread.State
A more interesting one is java.util.concurrent.TimeUnit
An example of a class which IMHO would be an
enumbut predates them is ByteOrder See Joachim’s comment above.