Sunil Kumar wrote:I see no reason for a singleton class to have a protected constructor. The purpose of "singleton" is then defeated.
It's mostly done so the singleton class can be subclassed, but I agree that it's a bad idea. Any class in the same package, as well as all sub classes, can also create new instances.