hi
can anyone tell me why in the following code the statement char c = 'b'-'a' has no compile error
'b'-'a' might get converted to int and there is no cast either
then why doesn't compiler complain bout it
even if the substraction is in char's range a unary operator converts it to int
class testit {
public static void main (
String args[]) {
byte primitiveByte = 1;
char primitiveChar = 'b'-'a';//why No compile error here ???
int primitiveInt = 1;
short primitiveShort = 1;
String s = "1";
Integer i1 = new Integer(primitiveByte);
Integer i2 = new Integer(primitiveChar);
Integer i3 = new Integer(primitiveShort);
Integer i4 = new Integer(primitiveInt);
Integer i5 = new Integer(s);
int p1 = i1.intValue() + i2.intValue() +
i3.intValue() + i4.intValue() +
i5.intValue();
System.out.print(p1);
}}