Disclaimer: I know that Python's eval() represents the possibility of a security breach and that exec() is rarely used. But I really need them in my project.
Are there equivalents to them in Java? Is it possible to evaluate expressions and execute Java code from String objects?
EDIT: This question is different from the one proposed because I also want an exec() (Which means that I want to execute general Java code from Strings objects, not just mere expressions).