-
What is the output of this program?
public class Result
{
public static void main(String args[])
{
Integer n = new Integer(260);
byte p = n.byteValue();
System.out.print(p);
}
}
-
- 0
- 1
- 2
- 3
- 4
Correct Option: E
n.byteValue() method returns the value of wrapper i as a byte value. n is 260, range of byte is 256 therefore n value exceeds byte range by 4 hence 4 is returned and stored in p.