About 1,960,000 results
Open links in new tab
  1. Is there an eval () function in Java? - Stack Overflow

    Apr 9, 2010 · Wrap the expression in the Java source code for a class with an eval method, send that to the Java compiler, and then load the resulting compiled class. Use some scripting …

  2. java - How to evaluate a math expression given in string form?

    May 23, 2013 · @FunctionalInterface interface Expression { double eval(); } Now to rework the original "eval" function into a "parse" function, change all the methods that return doubles, so …

  3. Is there a java equivalent of the python eval function?

    Aug 22, 2011 · Based on this Java Tip, compiling a Java string on the fly is indeed possible, if you are willing to use com.sun.tools.javac.Main.compile(source). Classes in com.sun.tools are of …

  4. Method for evaluating math expressions in Java - Stack Overflow

    Adding another option to the list, I wrote Jep Java which gained a lot of popularity as an open source project on sourceforge. It supports all the basic common tasks of expression parsing. …

  5. ImplementIon of eval() in Java - Stack Overflow

    Dec 29, 2011 · Building a Java compiler yourself is a tremendous work. Basically, there are three options: Use ToolProvider.getSystemJavaCompiler(). The second answer at How to create an …

  6. How to create an object from a string in Java (how to eval a string ...

    Dec 18, 2011 · I know eval is "evil", but I'm using it in a way that the user can't ever abuse it. Let's say I've got a string "new Integer(5)". I want to do something such that I can set a variable, …

  7. string - Evaluating code at runtime in Java - Stack Overflow

    Jan 5, 2012 · Possible Duplicate: Is there a java equivalent of the python eval function? There is a String, something like String str = "if a[0]=1 & a[1]=2". How to use this string in a real IF …

  8. Evaluating a math expression with variables. (java 8)

    Dec 5, 2016 · Actually the code manipulates the map and as the expression holds a reference to it, each subsequent call to the expression's eval-method will take the adjusted value. So in …

  9. Java: Returning an object from ScriptEngine javascript

    Jun 26, 2016 · Exception in thread "main" javax.script.ScriptException: <eval>:1:25 Invalid return statement var obj = { value: 1 }; return obj; ^ in <eval> at line number 1 at column number 25 …

  10. eval - Use Javascript scripting engine in Java 17 - Stack Overflow

    Mar 15, 2022 · I have to move a project from Java 8 to Java 17. I could solve most issues, but it contains a method, in which I use the ScriptEngineManager to evaluate a mathematical term. …

Refresh