Please see the code below:
After compiling and execution, the result is
C:\>
java TestSwitch
enter x....
I am a little bit confused: x is a short type, however i is an int type,
why it still can be compiled?
In K&B, they say --- A case constant must evaluate to the same type as the switch expression can use. Page 324
same type??