I have a string variable, that holds a mathematical equation such as 4+5-6/(9+3) now i would like to be able to take this string variable and have the java compiler execute a line of code.
Such as
if i wanted to execute this command to store it in a var, but dont want to have the user pick the equation then i would do:
sum = 4+5-6/(9+3);
and sum woul equal 8.5.
now what if it was like this:
String equation;
equation = textFeild.getText();
sum = // Now what would i put here
Hope this explains it.
If you need more explination just post.
Thanks all.
Such as
if i wanted to execute this command to store it in a var, but dont want to have the user pick the equation then i would do:
sum = 4+5-6/(9+3);
and sum woul equal 8.5.
now what if it was like this:
String equation;
equation = textFeild.getText();
sum = // Now what would i put here
Hope this explains it.
If you need more explination just post.
Thanks all.