Is it possible to convert a String such as 1 + 2 into an integer that equals 3?
I know I can use valueOf() to get the value of individual numbers
String test1 = "1";
String test2 = "2";
int test3 = Integer.valueOf(test1);
int test4 = Integer.valueOf(test2);
int answer = test3 + test4;
System.out.println(answer);
but is it possible to convert "1 + 2" to 3 in one step instead of two?