Answer:
Though we 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 not 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 does not make sense.
Asked In: Many Interviews |
Alert Moderator