Answer:
Private constrors are the special kind of constructor, which are allowed to not set create instace of a class from outside of the class. They are basically created when a class only have static members.
when you want to craete a single instance of class than use private constructor, basically they are used for Singlton pattern also.
Asked In: Many Interviews |
Alert Moderator