String num = "9+9";
double answer = Double.parseDouble(num);
I understand I could use something called ScriptEngineManager. I copied that code, and was given the following error:
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "javax.script.ScriptEngine.eval(String)" because "engine" is null
at WritingClasses.Test.EvalMath(Test.java:25)
at WritingClasses.Test.main(Test.java:11)