- class Outer {
- static class Inner1 {
- public void method() {//①
- System.out.println("Inner method()");
- }
- }
- class Inner2 {
- public static void print() {//②
-
- System.out.println("Inner2 print()");
- }
- }
- public void run() {
-
- int num = 10;//③
- public class Inner3 {//④
- public void show() {
- System.out.println(num);
- }
- }
- Inner2 i = new Inner2();
- i.show();//⑤
- }
- }
复制代码 |