Let's consider some simple expressions in Java.
byte var=0;
var=(byte)(var+1);
Here, in the above statement, obviously type casting is needed because of automatic type promotion.
The evaluation of the expression (var+1) is automatically promoted to int hence, must explicitly be cast to byte to assign the outcome of it to a byte variable on the right of the assignment which is var
Now, let's consider the following statement in Java.
var++;
This is somewhat equivalent to the previous statement and should have needed a cast though it works without a cast. Why?
Even the following statement doesn't require a cast. Why?
byte x=var++;