File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes enum doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "enum doubt" Watch "enum doubt" New topic
Author

enum doubt

dolly shah
Ranch Hand

Joined: Jun 18, 2007
Posts: 383
I am taking Whizlabs exams. I got one enum related question. Enum is in the class. They have written in answer description that " enum declared in a class so it is static member of a class". As per I know enum values are static. How can be the enum static? CAn anyone please explain?


SCJP-1.5<br />SCWCD-1.4
ahmed yehia
Ranch Hand

Joined: Apr 22, 2006
Posts: 424
Enum declared inside a class become static member of that class, just like static nested classes. So no instance of the enclosing class is required to create such enum, just class name.
dolly shah
Ranch Hand

Joined: Jun 18, 2007
Posts: 383
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: enum doubt
 
Similar Threads
Declaring Enums in a class
Related to Enum const specific class body
enum
Enum doubt
Please explain why enums must not be declared within a method.