Hi Intizam Integer has been assigned to byte which is narrowing of conversion. But the narrowing of conversion is taking place within the range of byte which is -128 to 127 and hence should work fine. Hope this explains. Regards Sandip
Intizam , Welcome to javaranch. PROPER NAMES ARE NOW REQUIRED Please look carefully at official naming policy at javaranch & reregister yourself with proper first & last name. Please adhere to official naming policy & help maintain the decorum of the forum. Waiting for your posts with proper first & last name. Once you have reregister , please let us know about that & then your previous account will be disabled. Regards.
Integer LITERALS can be assigned to byte, short and char if the interger LITERALS are within the range of byte, short and char. 100+10=110, 110 is an integer literal and within the range of byte (-128 -- 127), so it can be assigned to byte type variable b.
Good night. Drive safely. Here's a tiny ad for the road: