この Java のビットが 3 ではなく 2 を生成する理由を知りたいと思っていました。
public class Test {
private static class A {
int f(A a) {
return 1;
}
}
private static class B extends A {
int f(A a) {
return 2;
}
int f(B b) {
return 3;
}
}
public static void main(String[] astrArgs) {
A ab = new B();
B b = new B();
System.out.println( ab.f(b) );
}
}
テストの質問でこれに出くわしましたが、その背後にあるロジックを理解できませんでした。