posted 14 years ago
Hi all,
I have a query regarding enums. I don't if it's too obvious to ask such a doubt; but pardon me, am new to Java5.0 and have just started preparing for SCJP5.0.
Iam trying to code using enums and found out that enum constructors can either have default access or private access. Why are the other access modifiers not allowed for enums? I read somewhere that it's to prevent enum instance being created by ourselves; but in that case why is default allowed? Default access or package access will also allow the same in the package in which the enum is defined right?
Kindly some1 help me:(