Understanding java program
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/7924961/weird-java-behavior-with-casts-to-primitive-types">Weird java behavior with casts to primitive types</a>  </p>
</blockquote>



<p>Why following prints <code>1</code>?</p>

<pre><code>int i = (char) - (int) + (long) - 1;
System.out.println(i);
</code></pre>

<p>Why above lines of code prints 1? How come the value of <code>i</code> become 1?</p>
