I have a question about this code example:
Why do we have a compiler time error?
Casting comes befor + operator, so I dont' understand why do we have int now.
Code: Select all
short a = 1;
short b = 2;
short c = (short)a + (short)b;
Code: Select all
int c = a + b;
Code: Select all
short c = (short) ( a+b )