I'm trying to write a program that will run a method given the code as a string.
Here is an example:
public static void main(String[] args) {
String code = "public class Test { public static void test() { System.out.println(\"This is a test!\"; } }";
// somehow load that string as a class
// then run the method Test.test() and have the results printed
}
If this is possible or has been done before, I'd greatly appreciate a direction to take to achieve this.