Can we Inherit the class defined with private constructor?

 Posted by Kundan64 on 1/15/2013 | Category: C# Interview questions | Views: 3115 | Points: 40
Answer:

No, we can not inherit the class defined with private constructor.
 public class A:B

{
}
public class B
{
private B()
{
}
}

Here if we will compile this code error will come:
Namespace.B.B() is inaccessible due to its protection level


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response