What is a private constructor? where will you use it?
Answer Posted / nevin jain
In singleton pattern we make the class sealed n keep
contractor as protected
......which is same as keeping class with any access
modifier with private constructor..
both pattern is the example of singleton pattern..
basically this pattern say that only single instance can be
created of the class which can be achieved either by private
constructor or sealed class with protected constructor..
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
How do you sort a list in c#?
How to Show Message box in Metro Style App?
What can I create with c#?
What is winforms c#?
What is Private Constructor? and it’s use? Can you create instance of a class which has Private Constructor?
What is a datacontract?
What’s a strong name?
Is a structure a class?
What does void mean in c#?
What is difference between C# and VB.NET?
Is versioning applicable to private assemblies?
What is difference between ienumerable and list?
List the different stages of a thread?
Enlist some of the properties of a thread class?
What is a property c#?