posted 16 years ago
Please correct me if my understanding is wrong. Enums are not objects. Enums are actually just ENUMS.
(There's a java.lang.Enum in the API. I am doubtful if they're the same though)
They can be declared inside and outside classes.
When enums are declared inside a class, and upon instantiation of that class, (1) they live on the heap. Hence (2) they're treated as class variables, or instance variables of that class.
Are (1) and (2) correct?
What happens when the enums are declared outside the class. Upon usage (or upon indirect invocation of constructors if they have) where do they live?
[ June 21, 2008: Message edited by: Denise Saulon ]
[ June 21, 2008: Message edited by: Denise Saulon ]
SCJP/OCPJP 6 | SCWCD/OCPJWCD 5 | OCMJEA in progress...