interface InterfaceX { public void methodx(); } interface InterfaceY { public void methody(); } interface InterfaceZ { public void methodz(); } class ClassXY implements InterfaceX, InterfaceY, InterfaceZ { public void methodx() { System.out.println("method x of InterfaceX"); } public void methody() { System.out.println("method x of InterfaceY"); } public void methodz() { System.out.println("method x of InterfaceZ"); } } class InterfaceEx3 { public static void main(String arg[]) { ClassXY y = new ClassXY(); y.methodx(); y.methody(); y.methodz(); } } /* * ------------------OUTPUT------------------------ method x of InterfaceX * method x of InterfaceY method x of InterfaceZ */
Related Tags for Interface Example-3: