You can not instantiate abstract class in java. In order to use abstract class in Java, You need to extend it and
provide a concrete class. Abstract class is commonly used to define base class for a type hierarchy with default implementation,
which is applicable to all child classes. Now based on these details, can we have constructor in abstract class? The answer is YES, we
can have. You can either explicitly provide constructor to abstract class or if you don't, compiler will add default constructor of
no argument in abstract class. This is true for all classes and its also applies on abstract class.
|