代码部分:
IFactory operateFactory = AddFactory();修改这里就可以啦,当然必须保证有这样的操作类供选择
Operation operation = operation.setNumberA(20 operation.setNumberB(34 result = }
}
AddFactory
}
result = 0
setNumberA( .numberA =
setNumberB( .numberB =
}
AddOperation
result = 0 result = getNumberA() + }
原文链接:https://www.f2er.com/javaschema/70133.html