Can we create instance of private class in c#?



Can we create instance of private class in c#?..

Answer / Ravinder Kumar Jawalia

No, it is not possible to create an instance of a private class directly from another class or outside the defining class because its constructor is marked as private. To work around this, you can use factory methods or singleton patterns.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Is c# static or dynamic?

1 Answers  


what are implementation inheritance and interface inheritance?

1 Answers  


What is eager and lazy loading in c#?

1 Answers  


Can private virtual methods be overridden in c#.net?

1 Answers  


What is the difference between hashtable and dictionary?

1 Answers  


How many keyword present in C# language ?

1 Answers   HCL,


Is void a class?

1 Answers  


What is c# best for?

1 Answers  


What is the use of the dispose method in C# ?

1 Answers   Infosys,


How to use the sreamReader class to read form a text file?

1 Answers   MCN Solutions,


What is a virtual property. Give an example?

1 Answers  


What is anonymous types in c#?

1 Answers  


Categories