<strong>Possible Duplicate:</strong> using eval in Java
Is there anything like that in C# or JAVA which lets me run C# or JAVA code?
String time = Eval("My csharp code");
Or Am I completely off the track?
Maybe you can use something like this: http://www.codeproject.com/Articles/11939/Evaluate-C-Code-Eval-Function
Maybe you can use something like this: http://rsudhakar.wordpress.com/2010/11/03/eval-in-java/
You can use Beanshell in Java. This produces a scripting library for Java and is used in many debuggers for ad hoc expressions.
However, use of "eval" or dynamic code is discouraged in Java (and I suspect most languages it's not a good idea)
There is no direct analogue - there is no built in function that will take a string and run it as executable code.