Java中的Enum的继承
public interface Icolor{ int apply(int x,int y); } public enum color implements Icolor{ plus("+"){ public int apply(int x,int y){ return x+y;} }, min("-"){ public int apply(int x,int y){ return x-y;} } ; private final String num; color(String num){ this.num=num; } }
//调用 color.plus.apply(100, 1)