0

Bit of a concept I can't quite wrap my head around, according to oracle docs:

Note: The constructor for an enum type must be package-private or private access.

I don't understand what it means for an enums constructor to be package-private if you can't instantiate enums that way anyway, whether you're in the same package or not. Does it not make more sense to say that an enums constructor is always private? Am I missing any implications about an enum constructor being able to be package-private here?

BRNTZN
  • 564
  • 1
  • 7
  • 21
  • Or actually this duplicate could be better: [Why can a enum have a package-private constructor?](http://stackoverflow.com/questions/7747948/why-can-a-enum-have-a-package-private-constructor) – Pshemo Dec 25 '15 at 23:54
  • In short: package-private means lack of visibility modifier, in which case Enum makes it `private` for us implicitly, so either way you are ending up with private constructor. – Pshemo Dec 25 '15 at 23:55

0 Answers0