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)

 

相关文章:

猜你喜欢
  • 2022-12-23
  • 2021-12-05
  • 2021-12-05
  • 2021-12-22
相关资源
相似解决方案