我想做到以下几点:如何将super分配给变量?
public class Sub extends Super {
public Sub(Super underlying) {
if (underlying == null) {
underlying = super; // this line is illegal
}
this.underlying = underlying;
}
@Override
public void method() {
underlying.method();
}
}
怎么能像这样做呢?
你正在尝试使用此代码来解决? – 2013-02-26 17:03:52
为什么不简单地在重写的方法内使用'super.method()',那么'underlying.method()'的需求是什么?为什么你在做什么,你在做什么,将高度赞赏:-) – 2013-02-26 17:06:40
为什么你不直接调用'super'? – moeTi 2013-02-26 17:06:47