Hi Ponraj
As per my understading the line "byte b = 16" works becuase the value is in byte range that is -128 to 127.
If you try to assign the value out of range it will throw compile time error.
If you try to compile the line "byte b = 16.2", you will get compile time error:
possible loss of precision
found : double
required: byte
byte b =16.2;
^
1 error
so if you compile line "byte b = 16.2" with the explicting cast as "byte b = (int)16.2", you get output as 16 which is the integer of part of number 16.2.
Regards,
Varsha
