class A {
void foo() {
System.out.println("A.foo");
}
}
class B extends A {
@Override
void foo() {
System.out.println("B.foo");
}
}
// Class C, subclass of B, also overrides foo
class C extends B {
@Override
void foo() {
System.out.println("C.foo");
}
}
In this example, A.foo is overriden by B.foo and C.foo.
overridingMethods on A.foo returns only B.foo.
It should return both B.foo and C.foo. It should not stop to look down when it finds an overriding method.
In this example,
A.foo
is overriden byB.foo
andC.foo
.overridingMethods
onA.foo
returns onlyB.foo
. It should return bothB.foo
andC.foo
. It should not stop to look down when it finds an overriding method.