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 interface used in c#?
What is int16?
What happens if a static constructor throws an exception?
Different between method overriding and method overloading?
hi all.... i need code snippets for store and retrive tiff fromat images in sqlserver....... kindy provide it.......
What is the difference between method and constructor in c#?
What is object type in c#?
Why do I get a security exception when I try to run my c# app?
What do you mean by hashtable c#?
What are strongly typed objects?
What is the difference between class and namespace?
Is c# int immutable?
What is cls, cts and clr in net?
What is the difference between list and arraylist c#?
What is difference between a type and class?