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