- class Uu {
- public static void main(String[] args) {
- Outer o = new Outer();
- o.print();
- }
- }
- class outer {
- private int num = 19;
- private class Inner { // 私有之后需要
- public void method(){
- System.out.println(num);
- }
-
-
- }
- public void print(){
- Inner i = new Inner();
- i.method();
- }
复制代码 |
|