package inheritance.incorrect; /** This examples shows an incorrect multiple interface inheritance. * If it were allowed, c.m2() would have difficulty in selecting the implementation. * This is also an example of strong typing: the compiler tries to find as many * potential errors as possible. */ public class C implements A, B { /** Compiler would report error */ public int m2(int x){ return x; } public String m2(int x){ return new String(x+1); } } }