1An abstract method is the method which does’nt have any body.
2Abstract method is declared with
3keyword abstract and semicolon in place of method body.
4
5 public abstract void <method name>();
6Ex : public abstract void getDetails();
7It is the responsibility of subclass to provide implementation to
8abstract method defined in abstract class
1abstract class AbstractDemo { // Abstract class
2 private int i = 0;
3 public void display() { // non-abstract method
4 System.out.print("Welcome to Tutorials Point");
5 }
6}
7public class InheritedClassDemo extends AbstractDemo {
8 public static void main(String args[]) {
9 AbstractDemo demo = new InheritedClassDemo();
10 demo.display();
11 }
12}
1abstract classes have no implementation of functions methods inside it which declared as abstract methods. classes which are inheriting it have to overriden it. and final absract class can not be overriden
2