如何在Java运行时获得算术运算符?假设我有价值
ADD它应该加数字MUL,那么它应该乘以这个数例如
public calculate(int x, String str){
while(str.equals("some value")){
If( str.equals("ADD"))
// it should return me something like x+
if( str.equals("MUL"))
it return me something like x*
}
if( str.equals("FINAL"))
it should return me x+x*x
}https://stackoverflow.com/questions/10859834
复制相似问题