java example for abstract method:
What is the problem with below Java program?
public void disp();
There is no problem in this given program.
Either we have to add body to the disp() method or we have to add abstract keyword to the method disp()
we have to make the class Base as abstract class by adding abstract keyword, as disp() method doesn't have any method body.
all are false.
If a method doesn't have body, then its mandatory to mark it as abstract method. Else compiler will throw error.
Back To Top