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 is asynccallback c#?
What are circular references?
Does c# have its own class library?
What is the diff between System.String and System.Text.StringBuilder classes?
Describe the process of “exception handling implementation” in c#?
What is executenonquery c#?
What is wcf c#?
What do you mean by stack and heap in c#?
What is type cast in C#?
What the different phase/steps of acquiring a proxy object in webservice?
Why is .net so popular?
How do I move from one form to another in c#?
How do I declare a pure virtual function in c#?
What is marshalling and what are different kinds of marshalling?
why delegate is type safe?