Can we have private constructor in our class file. When we
are trying to create instance for the class will it create
or throw error regarding that?
Answer Posted / saiish bhat
ya,we have private constructor.but it wont throw an exception.
but u cant create an instance of p.c.
it is not possible to inherit from that class also.
ex:
private class a()
{
}
class b : a
{ }
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What is string concatenation?
What do you mean by object pooling?
What is hierarchical inheritance in c#?
Is datetime immutable c#?
What is javascriptserializer c#?
If you donot specify an access modifier for a method, what is the default access modifier?
how to prevent a class from being inherited in c#.net?
What is c# and why it is used for?
Difference between Value type & reference types ? and give the example in .Net?
What is a private method in c#?
How does inheritance work in c#?
What is the difference between virtual method and abstract method?
What is instantiating a class in c#?
List some of the common data providers for ado.net framework?
What is a byte in c#?