Why private constructor is used ?
Urvi Solanki
Select an image from your device to upload
It is mostly used to create a singleton class.
Main use of creating Private constructor is that we cant create the object of that class which contains Private Constructor and the another use is that you can not inherit that class. Private constructor is also use to implement singleton pettern where you just want create the object of the class just once throughout the execution of the application.