Is there an equivalent to Python's exec() function in Java?

Viewed 1745

In python, you can use exec() to execute a piece of code.

Is there's any way to do this in Java, so that I can call a function from a string, but also do other things as-well like getting some user input and running it as Java code.

Note: This is not the same as Is there an eval() function in Java?; That only does eval() and I want exec().

1 Answers
Related