Hi, There is a simple chart given in RHE , which will make you understand this ..It's somthing like this .. byte -> short -> int -> long -> float -> double char -> int This shows, implicit casting, in opposite flow one has to do explicit casting.
[This message has been edited by swati bannore (edited August 09, 2001).]
Joined: Apr 14, 2001
What about casting between char and short ?
Joined: Oct 18, 2000
No There is NO implicit casting between (char and short) and char and int.
Originally posted by Angela Narain: What about casting between char and short ?
Byte Short, Char all are under int... and are peers to each other So they do need explicit cast if converted between each other However if int is converted to short and if int value is in the range of short , then implicit narrowing conversion will work ie short s = 10; //OK HTH