Skip to content
doubtly

What will be the error in the following Java code? byte b = 50; b = b * 50; a) b cannot contain value 50

What will be the error in the following Java code?

    byte b = 50;
    b = b * 50;

a) b cannot contain value 50
b) b cannot contain value 100, limited by its range
c) No error in this code
d) * operator has converted b * 50 into int, which can not be converted to byte without casting

Doubtly Asked Student doubt Save WhatsApp Report

1 answer

Your answer

Log in or create a free account to answer this question.