Home > Interview Questions > C#.NET > You cannot create an instance of an abstract class. So, what is the use of a constructor in an abstr...

You cannot create an instance of an abstract class. So, what is the use of a constructor in an abstract class?

by RAVINDRA   on 19/08/2014   Category: C#.NET   |  Level: Intermediate   |  Views: 2865    |  Points: 25     |  Starter 


Though you cannot create an instance of an abstract class, we can create instances of the classes that are derived from the abstract class. So, when an instance of derived class is created, the parent abstract class constructor is automatically called.

Note: Abstract classes can't be directly instantiated. The abstract class constructor gets executed through a derived class. So, it is a good practice to use protected access modifier with abstract class constructor. Using public doesn’t make sense.


« whats the difference between a++ and ++a in C#?
» Can an abstract class have a constructor? If so what is the use?
Post Question  |  Question Home

Recent Posts

User Responses


No response found, be the first to review this question.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts