Private enum constructor

A private constructor only allows objects to be constructed from within the class definition. Being an enum, it is easy to get confused, so I usually find it easier to think of an enum as a class with some special features. So when you write:

SLocale.EN_US

Basically, the parameters

Locale.US, "www.abc.com", "www.edc.com", "www.vvv.com", "www.earn.com"

will be passed to the private constructor so that the enum can be instantiated. Enum constructors have to be private.

Leave a Comment