我有一个抽象类如下:
public abstract class ServerClass extends AsyncServer {
private Validator serverValidator;
public ServerClass(Validator val) {
serverContext = ctx;
serverValidator = val;
}
public start() {
result(serverValidator.start("foo"));
}
abstract void result(String r);
};
然后,我将此方法称为:
ServerClass server = new ServerClass(validator) {
@Override
void result(String r) {
useString(r);
}
};
但由于某种原因,String r(从result()返回)为null。这段代码有什么问题吗?