The key is "if you print." Internally the compiler doesn't care. It's only when you need an external representation that it makes any difference. The binary representation of 32767 is 0111111111111111 and adding 1 to that gives 1000000000000000
Depending on whether you format the output to signed or unsigned integer, the decimal equivalent of this is either 32768 or -32768