The diff is simple
c+=i;
is treated as:
c = (char)(c+i);
Since the result of c+i is an int it requires an explicit cast. In the first code u havent provided this cast so compiler complains. But as u see above in the second case the cast is implied implicitly.
Remember this point. It is very imp for
SCJP exam
-Aj