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
What is strongly typed in c#?
What are the 4 pillars of any object oriented programming language?
Can constructor be protected?
Is c# code is unmanaged or managed code?
What is fcl in c#?
Explain the functionalities of satellite assembly?
Can a static class contain non static members?
Can we override interface method?
What does void mean unity?
Can the nested class access, the containing class. Give an example?
What is a Command Object in C#?
What is the difference between throw and throw ex?
what is a destructor?
What are access modifiers in c#?
What is the difference between CONST and READONLY?