aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes A static enumeration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "A static enumeration" Watch "A static enumeration" New topic
Author

A static enumeration

Mrinal Singhania
Greenhorn

Joined: Sep 30, 2012
Posts: 7
Hi,

The below code compiles fine even if the "static" keyword is removed for the enum declaration.



Can someone please explain?

Thanks.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4241
    
    7

From the Java Language Specification:
Nested enum types are implicitly static. It is permissible to explicitly declare a nested enum type to be static.

So it doesn't matter if you declare it as static or not, it will be treated as if it was.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A static enumeration
 
Similar Threads
enum question from K&B
Where are these methods documented
Enum Doubt
doubt in enums...anyone please help me out