Write a Java program to demonstrate the concept of interface inheritance
interface Vehicle { void start(); } interface Car extends Vehicle { void stop(); } class Sedan implements Car { @Override public void start() { System.out.println("Sedan is Starting"); } @Override public void stop() { System.out.println("Sedan is Stopping"); } } public class Main { public static void main(String[] args) { Sedan sedan = new Sedan(); sedan.start(); sedan.stop(); } }
Sedan is Starting Sedan is Stopping
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions