package pck1;
import java.lang.*;
public class superclass {
public class thesuper{
thesuper(){}
thesuper(String a){
System.out.println(a);
}
public void test(){
System.out.println("this is super class");
}
}
public class thechild extends superclass.thesuper{
thechild(){}
private void test1(){
System.out.println("this is the class class");
}
}
public static void main(String[] args){
System.out.println("this is the begin");
String aa = "this is superclass";
superclass sclass = new superclass();
thesuper super1 = sclass.new thesuper(aa);
thechild child1 = sclass.new thechild();
super1.test();
child1.test1();
child1.test1();
}
}
1 首先是实例化有问题,内部类的实例化,需要首先实例化外部类,这东西想破头也不知道怎么回事
2 为什么构造函数不可以使用默认的呢,非要写一下,