package java4;
public class InClass {
public static void main(String[] args) {
// TODO Auto-generated method stub
AA A = new AA();
///BB B = new BB();
A.Inmethod();
}
}
class AA{
private int i;
private String str;
public void Inmethod(){
class BB{ //内部类可以调用外部类私有成员,和私有成员函数
public void set()
{
i = 3;
str = "胡图图";
}
public void print()
{
System.out.println(str+"\t"+i);
}
}
BB b = new BB(); //局部类创造实例
b.set();
b.print();
}
}