What is difference between Static and Private Constructor?
What is difference between Static and Private Constructor?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
DarilPosted Nov 16, 2021, 7:42 AM
MahaPosted Dec 10, 2015, 3:21 PM
Rajeesh MenothPosted Dec 10, 2015, 6:01 AM
Private constructor is a special constructor that generally used in class that contains only static members. If class has only private constructors not any public constructor then it is not possible to create instance of the class. Basically private constructor prevents to create instance of the class. If you want to create instance of the class which has private constructor then you need to create a public constructor along with private constructor.
Ravi PatelPosted Dec 10, 2015, 3:39 AM