posted 19 years ago
can anyone explain this
byte a = 10 ;
final int x = 10 ;
Which of the following assigments are valid ?
Options :
a . byte y = x ;
b . char ch = a ;
c . char c = x ;
d . short j = a = x ;
I think the answer should be a,b,c,d but given is a,c,d
Why is that i can't assign a byte(8bits) to a char(16bits)
does this require an explicit cast??
TIA
[ June 01, 2004: Message edited by: Sudhakar Krishnamurthy ]