I want to conduct a little experiment, and generate a java program in a String (the experiment is itself in Java).
Now I want to test whether it compiles or not. How do I take a String
object in Java and see whether it is legal Java code?
Clarification:
String prog = "public interface B {public void speak();}"
boolean doesItCompile = ???