title: How to modify Java code while running in debug mode?
body: <p>How can I enable this "Debugging in Runtime" Notch is talking about in <a href="http://www.youtube.com/watch?v=BES9EKK4Aw4&amp;feature=player_detailpage#t=32s">this video</a> in Eclipse?</p>
  
  <p>As a test, I'd like to be able to edit the output of the following code and change it to "Hello Runtime Debugging" while it's running.</p>
  
  <pre><code>public class HelloWorld {
      public static void main(String[] args) throws InterruptedException {
          doIt();     
      }
  
      private static void doIt() throws InterruptedException {
          for (int i = 0; i &lt; 1000; ++i) {
              System.out.println("Hello World " + i);
              Thread.currentThread().sleep(100);
          }
      }
  }
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT:</strong> I modified the code, now I get the results I was looking for. Suraj Chandran's answer below explains it.</p>
  
  <pre><code>private static void doIt() throws InterruptedException {
      for (int i = 0; i &lt; 1000; ++i) {
          print(i);
          Thread.currentThread().sleep(100);
      }
  }
  
  private static void print(int i) {
      System.out.println("Hello Sir " + i);
  }
  </code></pre>