日期:2014-05-20 浏览次数:20642 次
class Out{
String name;
public void fun2(){
in i = new in();
i.fun();
System.out.println("out-->" + name);
}
class in{
//String name; //如果这里同名好像会把Out里面的覆盖
public void fun(){
//this.name = "in";
name = "out";
//System.out.println("in-->" + this.name);
}
}
public static void main(String[] args) {
Out o = new Out();
o.fun2();
}
}