What Will Be The Error In The Following Java Codep Pre Langjava #63
What will be the error in the following Java code?</p> <pre><code class="language-java"> byte b = 50; b = b * 50; </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs128 Java. It can also be found in gs gs128 Java Data Types Variables Arrays - Java Type Conversions, Promotions and Castings - Quiz No.1.
What will be the error in the following Java code?
byte b = 50; b = b * 50;
b cannot contain value 100, limited by its range
* operator has converted b * 50 into int, which can not be converted to byte without casting
b cannot contain value 50
No error in this code