File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Enum doubt" Watch "Enum doubt" New topic

Enum doubt

Geetha Gubendran
Ranch Hand

Joined: Sep 04, 2006
Posts: 75

I read that the access modifier for enum is default and public. But I read the below stmnt in some book. So Can I use any of the below modifiers for the enum that is declared within the class?

An enum declared outside a class must NOT be marked static, final,
abstract, protected, or private.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15092

Why don't you just try it out? Write a small test program, try to compile it, and see if you get any errors.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: Enum doubt
It's not a secret anymore!