package inheritance; /** This examples shows the multiple interface inheritance. * Same variable name in interfaces A and B does not cause a problem * since they are read only variables. * * Same method name won't cause a problem either because * they are not implemented in those interfaces, hence there is no * ambiguity in selecting which one of them. */ public class C implements A, B { /** * Although this method inherits m() from two interfaces A and B, * the implementation of m() is defined here in class C. Hence there * is no problem in determining which one to inherit. */ public void m() { System.out.println("m method"); } public static void main(String[] a) { System.out.println(A.x); // the meaning of x is determined by the class qualifier. System.out.println(B.x); new C().m(); } }