byte b=127; byte c=126; byte d=b-c; In the third line the compiler complains . It seams that the result is casted to int implicitly when two number calculate, but why? And are there any other cases do the implicit cast appears ?
From Kathy/Bert 's book, page 148-149: "the result of an expression involving anything int-sized or smaller is always an int. In other words, add two bytes together and you'll get an int." So the compiler will complain that it can't convert int to byte, you need to explicit case to byte.