title: getting hash values while trying to increment the value inside for loop in a java program
body: <p>I'm trying to get the output of 8 through this loop condition but I am getting this value instead:</p>
  <blockquote>
  <p>-2147483648</p>
  </blockquote>
  <pre class="lang-java prettyprint-override"><code>class Test1 {
      public static void main(String [] args) {
          int p = 2; 
          int j=5; 
          for (int i = p; i &lt; j; i++) {
              j++;
          }
          System.out.println(j);
      } 
  }
  </code></pre>
  <p>Why is it happening and where do I need to look into?</p>