How to parse a mathematical expression given as a string and return a number?

Viewed 91179

Is there a way in Java to get the result from this mathematical expression:

String code = "5+4*(7-15)";

In other hand what's the best way to parse an arithmetic expression?

10 Answers
Related