What is abstract class?

Abstract class is same like a class but with some extra features which has both abstract method as well as concreate/general method.

An abstract method is a method that has only declaration not implementation of the method.

Abstract class provides us partial abstraction because it contains concreate method inside an abstract class.

Abstract class can contain constructor so that multiple inheritance is not possible.

We can not create object of a abstract class. If any class which as abstract method the must have to declare our class as an abstract class and if don’t declare our class as a abstract class the we’ll get compilation error.

For implementing the abstract method we must have to implement the abstract class into the the child class. and in implementer class we must to override all the abstract method otherwise we’ll get compilation error.

For example we create a banking application and that application has some account type like current account and saving account which has some common feature like credit and deposit and both the account has some specific feature also like interest calculation at that situation we use abstract class. For common feature like deposit and credit we can use concreate method using that method we show some common message for both the account but for specific feature we use abstract method where both the account has different interest rate and based on the account type we can calculate interest.