Abstract class is a special type of class that does not contain the implementation of its functions i.e. it contains only declarations. And then the inheriting classes will provide the implementation of the methods.
Formally, a class with one or more abstract methods is known as abstract class.
Abstract method is a method whose definition is not present.
Program to illustrate the working of abstract method
Output:
Explanation:
In the above code, we have created an abstract class named student with abstract methods Get() and Put() which are then redefined in child classes, Bsc and Ba. Then we have asked the user for inputs and printed the student's details and percentage.
need an explanation for this answer? contact us directly to get an explanation for this answer