Friday, January 24, 2014

Private Constructor

1. One use of private construct is when we have only static member.
2. It provide implementation of singleton class pattern
3. Once we provide constructor (private/public/any) the compiler will not add the no parameter public constructor to any class.
4. If we still want to make object of the class having private constructor. We can have a set of public constructor along with the private constructor.

No comments: