What is the difference between i+=d and i=i+d in Java?
<h3>Duplicate:</h3>

<blockquote>
  <p><a href="http://stackoverflow.com/questions/608721/java-question">java += question</a></p>
  
  <p><a href="http://stackoverflow.com/questions/590868/why-arent-op-assign-operators-type-safe-in-java">Why aren’t op-assign operators type safe in java?</a></p>
</blockquote>

<p>When <code>i</code> is an integer and <code>d</code> is a <code>double</code>, <code>i+=d</code> works but <code>i= i+d</code> does not. </p>

<p>Why is this?</p>
