回复 5楼 林月儿
interface A {
void printinfo();
}
class X {
public void fun1() {
this.fun2(new A() {
public void printinfo() {
System.out.println("Hello World!");
}
});
}
public void fun2(A a) {
a.printinfo();
}
}
---------------------------------------------------------------------------------
偶然发现,这算不算接口的实例化了呢?求教