This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
There's nothing built into the langauge to evaluate an expression. You could probably google and find some libraries that will do it. To do it yourself you have to parse the string into tokens and interpret the operators. I did it in COBOL once for fun, but not in Java. Any recent computer science grad should have this in their class notes. If that's the path you want to take, maybe somebody will post some hints.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
1st thing: Welcome to the JavaRanch! We like to keep a professional lookin' image around here, and don't really fancy it when people try to show up the one-eyed moose. So if you could change your display name (click here), that'd be just dandy. (If you'd like a more thorough reason as to why I'm asking you to change your name, check out the Naming Policy.)
2nd thing: Looks like this is the same question as this one. So you might want to check out that thread to get some more insight. Guess you're both in the same class??