i need help...how can i have a program that a string like this ---"1 + 2 + 3"---could be read as integers and you can actually come to a single result using the precedence of operations...
That's not as easy as it sounds.
If you only have fairly simple mathematical expressions have a look at:
- if you have JDK 1.6, see reply #7 [http://forums.sun.com/thread.jspa?threadID=5144807]
- or if you have JDK 1.5 (or less), have a look at reply #12 from the same thread.
If you need more fancy math functions, Google for "JEP", or "mathematical expression parser".