How can I parse Java code stored in a String?
Example:
String s = "int i = 2; System.out.println(\"the number is: \" + i);";
How can I parse Java code stored in a String?
Example:
String s = "int i = 2; System.out.println(\"the number is: \" + i);";
You would probably try to use the JavaCompiler interface...
Search for JavaCompiler and ToolProvider (which is what you typically use to get hold of an instance of the interface) for tutorials etc.