为什么用 in.print(); 不能访问内部类变量
public class Classdemo {
public static void main(String[] args) {
outer out=new outer();
out.show();
outer.inner in=out.new inner();
in.print();
}
}
class outer{
int num=3;
String name="zhangsan";
void show() {
System.out.println("num="+num+" "+"name"+name);
}
class inner{
int num=8;
String name="lisi";
void print() {
show();
}
}
}