/**
* 外部类可以通过创建内部类的实例来访问内部类的私有成员????
*/
public static void main(String[] args) {
outer.Inner oi = new outer.Inner("Lucy", 15);
System.out.println();
}
}
class outer {
public static class Inner {
private int age;
private String name;
public Inner() {
}
public Inner(String name, int age) {
this.name = name;
this.age = age;
}
} |
|