posted 17 years ago
Hi Nana,
First of all, welcome to JavaRanch !
Enum is basically like any other class with some peculiarities. So the access modifiers rules for enums are the same as those used for a standard classes.
For the exam, keep in mind that you CAN define a enum as protected, private or even static only if such enum is a member of another class, otherwise, the only modifiers allowed are public or none (which behaves as default).
Here's an Example :
In summary, when you declare an enum as a member of any other class, you can use any modifier other than transient and volatile. In fact, an enum declared within a class behaves as it was a member of that class.
[ April 27, 2006: Message edited by: Edisandro Bessa ]
"If someone asks you to do something you don't know how to, don't tell I don't know, tell I can learn instead." - Myself