class Outer {
public void print() {
class Inner {
int i = 1;
public void eat() {
System.out.println("吃");
}
}
Inner inner = new Inner();
System.out.println(inner.i);
inner.eat();
}
}
class Demo {
public static void main(String[] args) {
Outer outer = new Outer();
outer.print();
}
} |
|