Originally posted by jignesh soni:
If you create a class with private constructor, how do you instantiate that class, if its not an inner class ?
As Rob Prime said, you instantiate the object inside the class, at this point
So, outside your class, you use getInstance method to get a reference to this object, i.e,
So, just to remeber,
"Private constructors prevent a class from being explicitly instantiated by callers" [ April 08, 2008: Message edited by: neilson ramalho ]