Knute Snortum wrote: . . .
Still a mystery is why b += 1; works. It may be that the compiler optimizes this to b++;
No. It is more complicated. If you go through the
Java Language Specification, you find it is a widening and narrowing conversion. If you look in a book like
Java Puzzlers by Bloch and Gafter, you find they recommend you avoid += for any datatype less than 32 bits wide, because you can get confusing results.