//实现两个名字一样但返回值不一样的方法; public class TestClass implements A { public int a() { return 1; } private static class Inner implements B { public void a() { System.out.println("public void a()"); } } public static void main(String[] args) { TestClass tc = new TestClass(); Inner i = new Inner(); i.a(); System.out.println(tc.a()); } } interface A { public int a(); } interface B { public void a(); }