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 meant by generics in c#?
What is the benefit of dependency injection c#?
Why data types are important?
What is wpf c#?
What is the best dependency injection c#?
What is response redirect in c#?
What is the usage of transponders?
What are properties in c#. Explain with an example?
Why delegate is used in c#?
What can I create with c#?
What are escape sequences explain with example?
Why is dll used?
What is yield return in c#?
Define delegate in c#?
What are the different types of delegation?