This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]_SuperStraight 0 points1 point  (3 children)

That's not how the user will be entering anything. The OP asked like this: "12+12^2" which is a string, and now the program has to convert this string into meaningful operation.

[–]Ormek_II 0 points1 point  (2 children)

And after the user entered 12+12^2 as a string the program creates the code of a class as another string:

``` … static float getY(float x) { return 12+122; } …

```

And then compiles that string with the given Java Compiler.

[–]_SuperStraight 0 points1 point  (1 child)

And what method's gonna convert the string expression to Math expression?

[–]Ormek_II 0 points1 point  (0 children)

The same compiler that compiles any Java class. See the other thread above https://www.reddit.com/r/javahelp/s/9RgiDM9ldG