What will be the value of b at the end of the program?
class IntegerConversion {
public static void main(String args[]) { int i = 50000; byte b = i; } }
b will be 50000.
b will be between -32787 and 32786.
b will be between -128 to 127.
Program does not compile.
Correct Answer : D
Inside main, an int variable and byte variable are declared. b = i cannot be done since i is of type int and must be typecasted to byte explicitly since byte is smaller than int (i.e. size of byte < size of int). So the program does not compile.