class Demo2_NoNameInnerClass {
public static void main(String[] args) {
Outer o = new Outer();
o.method();
}
}
interface Inter {
public void show1();
}
class Outer {
public void method() {
new Inter(){
public void show1() {
System.out.println("show1");
}
}.show1();
}
}
求解这个程序的运行结果和原理 |
|