Write a program in java to implements multiple inheritance?

interface Interface1

{

                void display();

}

interface Interface2

{

                void print();

}

public class Star implements Interface1,Interface2

{

                public void display()

                {

                                System.out.println("Hello");

                }

                public void print()

                {

                                System.out.println("Hi");

                }

                public static void main(String arg[])

                {

                                Interface1 x=new Star();

                                Interface2 y=new Star();

                                x.display();

                                y.print();

                }

}

Implements Multiple Inheritance.PNG

, , , , ,

Leave a Reply