adplus-dvertising
frame-decoration

Question

What is the error in this code?
byte b = 50;
b = b * 50;

a.

b cannot contain value 100, limited by its range

b.

* operator has converted b * 50 into int, which can not be converted to byte without casting

c.

b cannot contain value 50

d.

No error in this code

Posted under Java Programming

Answer: (b).* operator has converted b * 50 into int, which can not be converted to byte without casting

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the error in this code?