« Back
interface i1 { void show(); } interface i2 { void show(); //here we are creating another show method when we have in interface i1 and when I extends i1,i2 then why its not conflict //and when we creata a same name method in normal class then start ambiguity problem why becoz here is only declaration void disp(); //we don't need to define 4 methods in class A we have 2 define only 3 in class A } interface I extends i1,i2 { void hi(); } class A implements I { public void show() { System.out.println("show A"); } public void disp() { System.out.println("Disp A"); } public void hi() { System.out.println("Hi A"); } } class MInherit { public static void main(String args[]) { I o =new A(); o.show(); o.disp(); o.hi(); } }
×
Report a Problem:
Description:
Submit