Why do we need a private constructor?
- by isthatacode
if a class has a private constructor then it cant be instantiated.
so, if i dont want my class to be instantiated and still use it, then i can make it static.
what is the use of a private constructor ?
Also its used in singleton class, except that, is there any othe use ?
(Note : The reason i am excuding the singleton case above is because I dont understand why do we need a singleton at all ? when there is a static class availble. You may not answer for my this confusion in the question. )