project cleanup
- test classes (src/test/*) moved to separate root - stray .class files dropped - binary files (bin/, dist/full/, dist/obfuscated/) excluded from the repo - .classpath and .gitignore updated accordingly - invalid import statements removed
This commit is contained in:
51
test/test/misc/en/Operation.java
Normal file
51
test/test/misc/en/Operation.java
Normal file
@@ -0,0 +1,51 @@
|
||||
package test.misc.en;
|
||||
|
||||
public enum Operation {
|
||||
|
||||
PLUS(2) {
|
||||
double eval(double x, double y) { return x + y; }
|
||||
},
|
||||
MINUS(7) {
|
||||
double eval(double x, double y) { return x - y; }
|
||||
},
|
||||
TIMES(8) {
|
||||
double eval(double x, double y) { return x * y; }
|
||||
},
|
||||
DIVIDED_BY(0) {
|
||||
double eval(double x, double y) { return x / y; }
|
||||
};
|
||||
|
||||
|
||||
// Perform the arithmetic operation represented by this constant
|
||||
|
||||
abstract double eval(double x, double y);
|
||||
|
||||
Operation(int t) {
|
||||
|
||||
// class LocalClass {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// LocalClass e = null;
|
||||
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
|
||||
public static void main(String args[]) {
|
||||
double x = Double.parseDouble(args[0]);
|
||||
double y = Double.parseDouble(args[1]);
|
||||
|
||||
Operation opp = Operation.DIVIDED_BY;
|
||||
|
||||
switch(opp) {
|
||||
case MINUS:
|
||||
System.out.println();
|
||||
case PLUS:
|
||||
}
|
||||
|
||||
for (Operation op : Operation.values()) {
|
||||
System.out.println(x + " " + op + " " + y + " = " + op.eval(x, y));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user