Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the default modifier fields for an enum type?

Tags:

java

This is a homework question, so I'm not looking for a direct answer. I need a push in the right direction. I'm simply not understanding the question. My answer to this was "The values are, in fact, instances of their own enumeration type." Which came back incorrect. I'm looking at the API now...is this referring to the methods listed in the methods summary?

I'm noticing from this page that modifier types for Java in general refer to access control (private, public, protected) and non-access modifiers (static, final, abstract, volatile).

I'm putting public, protected for my next answer as I see those two listed within the API for access control. Am I thinking about this correctly?

Got back my homework, turns out I was correct.

like image 322
thefonso Avatar asked Feb 05 '11 03:02

thefonso


1 Answers

The modifiers for each constant are implicitly declared, as mentioned in the Java Language Specification, §8.9 Enums. As a corollary, consider which modifiers are associated with all-upper-case identifiers in the widely used Google Java Style or Java Coding Style Guide?

like image 140
trashgod Avatar answered Sep 28 '22 03:09

trashgod