What is a private constructor? where will you use it?
Answer Posted / saurabh
In singleton pattern the constructor is not private but
protected.
Go for private constructor when your class has methods which
do not require object creation. ex. (Math class in c#).
Like If your class has all static method, you need not to
create an object in that case go for private constructor.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What are predicates in c#?
Explain what is the smallest unit of execution in .net?
What is the difference between list and ilist in c#?
What is connection pooling in ado.net?
Is static class thread safe in c#?
What are the Types of configuration files and their differences
Can enum be null c#?
Why does my windows application pop up a console window every time I run it?
What is static classes in c#?
What is delimiter in c#?
What kind of the information stored inside the assembly?
What is int parse in c#?
Is everything an object c#?
What are value types and reference types?
Why linq is having select clause at the end?