onemoo
public class Outter {
private Inner in;
public Outter() {
in = new Inner();
}
private class Inner {
private void test() {
System.out.println("test");
}
}
// 因为外部类可以直接访问内部类的private成员,所以直接通过in调用test()即可
public void func() {
in.test();
}
// 一个简单的main
public static void main(String[] args) {
Outter out = new Outter();
out.func();
}
}