Simon Roberts in his book
Java 2 certification guide mentions with reference to Unary operators that
There are 2 rules that apply depending on the type of the operand
1)If one of the operand is a byte, a short or a char,it is converted to an int
using this rule the code given below when compiled should give a type mismatch error as converting an int to a char requires a cast.Surprisingly not only does this code compile but when it is run,The output is - The character is now b
Why does this hapen ?
[This message has been edited by dhruv simaria (edited March 27, 2001).]