没有实现抽象方法的具体类居然编译通过了
来自csdn:
http://topic.csdn.net/u/20110131/09/7099a295-3877-4b2d-81bd-46137e5530c9.html
?
package pack1;import pack2.B;public class C extends B {public static void main(String[] args) {A the = new C();the.set();}}
?
let's have a try, if you compile it, you'll find no error occurs at compile time, why? as B does not override A, but the compilation passed, according to the java doc:
?
public class AbstractMethodErrorextends IncompatibleClassChangeError
Thrown when an application tries to call an abstract method. Normally, this error is caught by the compiler; this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled.
?
no changes have been made, it still passes, is it the bug of the javac? let's check it out.