public interface ICalculator { public int calculate(String exp);}public class Minus extends AbstractCaculator implements ICalculator { @Override public int calculate(String exp) { int arrayInt[] = split(exp, "-"); return arrayInt[0] - arrayInt[1]; }}public class AbstractCalculator { public int[] split(String exp, String opt) { String[] array = exp.split(opt); int arrayInt[] = new int[2]; arrayInt[0] = Integer.parseInt(array[0]); arrayInt[1] = Integer.parseInt(array[1]); return arrayInt; }}Icalculator cal = new Minus();cal.calculate(exp);