Online Java Compiler By
JavaTpoint.com
abstract class Vehicle { abstract void display(); abstract void display(String msg); } class Honda extends Vehicle { @Override void display() { System.out.println("abstract method is invoked"); } @Override void display(String msg) { System.out.println(msg); } } public class AbstractExample4 { public static void main(String[] args) { Honda obj=new Honda(); obj.display(); obj.display("overloaded abstract method is invoked"); } }
Output