public class A {
public void foo(A a) { System.out.println("A/A"); }
public void foo(B b) { System.out.println("A/B"); }
}
public class B extends A {
public void foo(A a) { System.out.println("B/A"); }
public void foo(B b) { System.out.println("B/B"); }
}
public class Main {
public static void main(String[] args) {
A a = new A();
A b = new B();
a.foo(a);
b.foo(b);
}
}
$ java Main
A/A
B/A
$ groovy Main.groovy
A/A
B/B
Unveiling RxMule
9 years ago
No comments:
Post a Comment