Menu
Question Index
...

What will be the output of the following program?

public class ConvertToInt {
    public static void main(String[] args) {
        Byte data = new Byte((byte) 130);
        System.out.print(data + " ");
        int i = data.intValue();
        System.out.print(i);
    }
}


130 130
-126 -126
Compilation Error
Runtime Error

Doubts

Problems

Topic: Creating Objects for Primitive Data Types (Byte, Short)

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App