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 difference between il and dll ?
Whats an assembly? Describe the importance of assembly?
What is lazy loading entity framework?
What is difference between ienumerable and list?
What is a multicast c# delegate?
Explain manifest & metadata in c#.
What is iqueryable?
Explain static class members.
What are satellite assemblies? How will you get the different language strings?
What exactly happens when we debug and build the program?
What are the Types of caching
What is the difference between var and dynamic types in c# 4.0?
What is access modifier in c#?
Can we write class inside a class in c#?
Is c# still popular?