+ 9

How to evaluate a simple Java expression in string?

For example: String result = eval("(10+sin(3.14))/2");

9th Mar 2019, 3:22 PM
Андрей Чачин, Andrew Chachin
Андрей Чачин, Andrew Chachin - avatar
3 ответов
+ 9
First way: Evaluate JavaScript expression in Java via ScriptEngineManager https://code.sololearn.com/cOdXAq93T7uz
10th Mar 2019, 6:43 PM
Андрей Чачин, Andrew Chachin
Андрей Чачин, Andrew Chachin - avatar
+ 7
Second way: Evaluate expression via jrunscript https://code.sololearn.com/cnG5YZ2SLEAK
11th Mar 2019, 2:06 PM
Андрей Чачин, Andrew Chachin
Андрей Чачин, Andrew Chachin - avatar
- 2
How long does it normally take to learn python?
12th Mar 2019, 3:49 AM
sim simon