Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class EnumCalculator {
- //Notice how concise the code has become in the logic
- public int calculate(char op, int a, int b) {
- return OperationEnum.of(op).operate(a,b);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement