Write a Java program to demonstrate an abstract class having both abstract and non-abstract methods
abstract class Vehicle { void start() { System.out.println("Starting vehicle..."); } abstract void stop(); } class Car extends Vehicle { @Override void stop() { System.out.println("Stopping car..."); } } public class Main { public static void main(String[] args) { Car car = new Car(); car.start(); car.stop(); } }
Starting vehicle... Stopping car...
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions