读书人

内隐类的继承有关问题

发布时间: 2012-09-22 21:54:54 作者: rapoo

内隐类的继承问题
package Test;

public class Father {
private String value;
Father(String v){
value=v;
}
class Son extends Father{

Son(String v) {
super(v);
// TODO Auto-generated constructor stub
}

}
class GrandSon extends Son{

GrandSon(String v) {
super(v);
/*在这里报错;No enclosing instance of type Father is available due to some intermediate constructor invocation
*/
}

}
}

读书人网 >编程

热点推荐