父类与子类之间构造函数方法的调用,急急!!!
怎么不能编译呢,该怎么修改?
class J_SubClass extends J_Test
{
}
public class J_Test
{
J_Test(int i)
{
System.out.println(i);
}
public static void main(String argv[])
{
J_SubClass a=new J_SubClass();
}
}
------解决方案--------------------
插入代码就不能着色标记了,重发下
public class J_SubClass extends J_Test{
J_SubClass(int i) {
super(i);
}
}
public class J_Test {
J_Test(int i) {
System.out.println(i);
}
public static void main(String argv[]) {
J_SubClass a = new J_SubClass
(1);
}
}