01: package sample.tests; 02: 03: public class Calculator { 04: 05: public Calculator() { 06: super (); 07: } 08: 09: public int calculate(int var1, int var2, String opt) { 10: if (opt.equals("+")) 11: return var1 + var2; 12: if (opt.equals("-")) 13: return var1 - var2; 14: return 0; 15: } 16: 17: }