I was just playing around with some code and was curious about the following result:
byte b = 50;
b *= 50;
System.out.println(b);
The output I get is -60
.
Why is this the case? Also, why don't I get a compile error as this seems to be a form of implicit type conversion (i.e. to an int).
For example, I cannot write the following:
b = b * 50;