A class which is declared with abstract keyword is known as abstract class. An abstract class cannot be instantiated. Means, we cannot create object of abstract class. The method and properties of abstract class are non-abstract unless they are explicitly declared as abstract.
Abstract classes are partially defined classes, methods and properties which are no implementation but must be implemented into derived class. If the derived class does not implement the properties of base class then is also meant to be an abstract class.
Abstract class or abstract function does not need to annotate with open keyword as they are open by default. Abstract member function does not contain its body. The member function cannot be declared as abstract if it contains in body in abstract class.
In this example, there is an abstract class Car that contains an abstract function run(). The implementation of run() function is provided by its subclass Honda.
A non-abstract open member function can be over ridden in an abstract class.
In above example, An abstract class Honda extends the class Car and its function run(). Honda class override the run() function of Car class. The Honda class did not give the implementation of run() function as it is also declared as abstract. The implementation of abstract function run() of Honda class is provided by City class.
In this example, an abstract class Bank that contains an abstract function simpleInterest() accepts three parameters p,r,and t. The class SBI and PNB provides the implementation of simpleInterest() function and returns the result.