在接口中利用匿名内部类实现接口
interface Jece {
public void send(String ni);
static public Jece getInstance(){
return new Jece(){
@Override
public void send(String ni) {
System.out.println(ni);
}
};
}
}
public class JavaDemo2 {
public static void main(String[] args) {
Jece.getInstance().send("麦观文");
}
}
**P266**