public enum Test {
jia {
public double test(double x, double y) {
return x + y;
}
},
jian {
public double test(double x, double y) {
return x - y;
}
},
cheng {
public double test(double x, double y) {
return x * y;
}
},
chu {
public double test(double x, double y) {
return x / y;
}
};
public abstract double test(double x, double y);
public static void main(String[] args) {
System.out.println(Test.jia.test(4, 2));
System.out.println(Test.jian.test(4, 2));
System.out.println(Test.cheng.test(4, 2));
System.out.println(Test.chu.test(4, 2));
}
}