SyntaxFix
Write A Post
Hire A Developer
Questions
Very good question. The Java Language specification confirms your suggestion.
For example, the following code is correct: short x = 3; x += 4.6; and results in x having the value 7 because it is equivalent to: short x = 3; x = (short)(x + 4.6);
For example, the following code is correct:
short x = 3; x += 4.6;
and results in x having the value 7 because it is equivalent to:
short x = 3; x = (short)(x + 4.6);