Name: tb29552 Date: 07/30/97
Reported by: "Roly Perera" <###@###.###> of GMID sa
The following class C is in error, since it
inherits an inaccessible abstract method from
B; however, javac considers B's f() to be
implemented by the concrete method in C,
resulting in an AbstractMethodError at
run-time when f() is invoked via B.
public abstract class B {
private abstract void f (); // now OK?
static class C extends B {
void f () { // implements private abstract method
}
}
public static void main (String[] args) {
B b = new C();
b.f();
}
}
class C extends B {
void f () { // oops: does NOT implement B.f!
}
}
======================================================================
- duplicates
-
JDK-1266571 no error for abstract method with private, final, native, synchronized modifiers
- Closed