title: donot understand why the answer is comming 6 when i have a loop of 5
body: <pre><code>public class Test implements Runnable {
  
      static int i;
  
      public void run() {
  
          System.out.println(i);
      }
  
      public static void main(String[] args) {
  
          Test t=new Test();
  
          for(i=0;i&lt;=5;i++){
              Thread t1=new Thread(t);
              t1.start();
              System.out.println("The main method:"+i);
          }
      }
  
  }
  </code></pre>
  
  <p>the answer i get is :-</p>
  
  <pre><code>The main method:0
  0
  The main method:1
  2
  The main method:2
  The main method:3
  The main method:4
  5
  The main method:5
  6
  6
  6
  </code></pre>