Q. What will be the output for the below code?
public class Test{
public static void main(String[] args){
byte i = 128;
System.out.println(i);
}
}
β
Correct Answer: (C)
Compilation fails with an error at line 3
Explanation: byte can only hold up to 127. So compiler complain about possible loss of precision.