title: Is there a way to escape from a printing statement and treat string variable as a valid code in java?
body: <p>I'm exploring some security issues in a piece of code and was wondering if there is a way to break out of the <code>System.out.println("");</code> statement and treat string as an executable code?</p>
  
  <p>So for example i have the following two lines:</p>
  
  <pre><code>String exit = "System.exit(0);";
  System.out.println(exit);
  </code></pre>
  
  <p>So, that instead of printing the <code>"System.exit(0);"</code> to console, I want JVM treat it as an executable code. Is it even possible? if so, does anyone have ideas on how to do it?</p>
  
  <p>Thank you</p>