1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
public class Test implements B { public static void main(String args[]) { Test t = new Test(); B a = (B) t; a.a(); } public void a() { System.out.println("A"); } public void b() { System.out.println("B"); } }