Write a Java program to demonstrate an abstract class having a default method
abstract class Shape { abstract void draw(); void info() { System.out.println("This is a shape"); } } class Circle extends Shape { @Override void draw() { System.out.println("Drawing circle"); } } public class Main { public static void main(String[] args) { Circle circle = new Circle(); circle.draw(); circle.info(); } }
Drawing circle This is a shape
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions