title: Call Main Recursively
body: <pre><code>public class Demo
  {
      static int i=0;
      public static void main(String args[])
      {
          System.out.println("Hello"+(i++));
          main(args);
      }
  }
  </code></pre>
  
  <p>In this program I am calling main with instance variable.</p>
  
  <p>It runs properly upto some point but after some <code>Hello</code> prints it gives <code>StackOverFlow</code> Exception.</p>
  
  <p>So i put int to find how many times it gets printed.</p>
  
  <p>I run this program it gives Exception after <code>i=4158</code>.</p>
  
  <p>But I run it several times it gives Exception at different value of i like <em>4155,4124,4154</em> etc.</p>
  
  <p>As I know here <code>StackOverFlow</code> is generated because of bad or Unconditional recursive call.</p>
  
  <p>I tried to figure out it but don't know what's exactly happening.</p>
  
  <p><strong>I want to know why after <code>4158</code> (or other values) ?</strong></p>
  
  <p>Is it dependent on my System or is it dependent on My Program?</p>