Discussion Locked

Java class that will perform arithmetic?

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Is ther a Java class that will resolve mathematical formulas that are input in the form of a string,e.g. (5 + (2 + 6)^2)/8 and return the correct numerical answer of the formula?

6 replies

by laurie_haischer

No. see this reference http://java.sun.com/j2se/1.4/docs/api/index.html
for all the java classes and methods in the latest standard release (J2 standard ed. 1.4).
Java.lang classes String, Math have methods that can be utilized to convert a String object into types to perform arithmetic operations to give the desired return type. You will have to do conversions and operations on the results in your statements.

This discussion is closed to new replies.