Abstract classes are used to define common set of properties that derived classes should have, abstaract classes serve as a base class for other classes to inherit from.
- Abstract classes can not be instantiated
- Abstract methods do not have a body and can only be declared inside an abstract class
- Abstract classes can have both abstract and non-abstract methods
- Non abstract methods can exist inside abstract classes to provide default behaviour for those specific methods
abstract keyword is used to declare classes or methods as abstract
*Abstract methods can only be declared inside abstract classes
Comments
Post a Comment