Write a Java program to demonstrate the use of interfaces for achieving multiple inheritance
interface A { void methodA(); } interface B { void methodB(); } class C implements A, B { @Override public void methodA() { System.out.println("Method A"); } @Override public void methodB() { System.out.println("Method B"); } } public class Main { public static void main(String[] args) { C c = new C(); c.methodA(); c.methodB(); } }
Method A Method B
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions