hi Shivani
well before doing for the conversion to decimal you can check for the size of the assigned operand
//first case
char c1 = 0xffff;
a character is an unsigned 16 bit integer
every hexadecimal bit represents 4 binary bit's (f==1111)
hence char c1=0xffff is valid
//second case
char c2 = 0xfffff;
the value being assigned is 20 bit long and a char can accept on 16 bits
hence u get the error
//third case
byte b1 = 0xffff;
byte is a 8 bit number and the above code tries to assign a 16 bit number to it hence you get the error
//forth case
well this is tricky and i am still working on as to why did u get an error
cos 0x7f is 0111 1111 = 127
are you absolutely sure you got an error???
the other two are fine
you can use this to eliminate options and to be sure with the remaining i guess you have to do it the hard way
Regards
Simon