uebungen/sources/beispieleVL/enumeration/Operation.java

23 lines
481 B
Java

package enumeration;
public enum Operation {
ADDITION {
public double anwenden(double op1, double op2) {
return op1 + op2;
}
},
SUBTRAKTION {
public double anwenden(double op1, double op2) {
return op1 - op2;
}
},
MULTIPLIKATION {
public double anwenden(double op1, double op2) {
return op1 * op2;
}
};
public abstract double anwenden(double op1, double op2);
}