Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help Please! How do i Convert a string to math operator?

807605Jun 24 2007 — edited Jun 26 2007
Hi. I am trying to write a calculator that takes a string from the user and calculates the expression. For example,

55 * 4 + ( 55 - 30 ) + 7

I can use the string tokenizer and seperate the string into individual parts, then use parsedouble for the numbers, but is there a way to parse the operators? i cant figure this out.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 24 2007
Added on Jun 24 2007
25 comments
2,388 views