Compilation failed because of being concieved of overriding between static and instance methods.
BUT, the inherited methods in A don't seem to be ambiguous with those in B.
//1 invoking instance method doo1() -> clearly, doo1() in A //2 invoking static method doo2() -> clearly, doo2() in A //3 invoking static method doo1() -> clearly, doo1() in B //4 invoking instance method doo2() -> clearly, doo2() in B
Why would the compiler think it's about to override than name resue???
[ December 17, 2006: Message edited by: Bob CHOI ]
Whether or not this compiles has nothing to do with main(). You can't override an instance method with a static method. End of story. Whether or not calls to the methods would be ambiguous or not is beside the point.
- static method can't be overridden by static method, but the static method name can be reused by static method in subclass - static method can't be overridden by instance method, but why can't the static method name be resued by instance method in subclass?