CoreJava.ch5.1.3
JDK1.4
interface A {
List getList();
}
class B implements A {
public ArrayList getList() {
return null;
}
}
error:
- The return type is incompatible with A.getList()
- implements A.getList
JDK5
没有编译错误。