Menu
Question Index
...

What will be the output of the following program?

public class WrapperClass {
    public static void main(String[] args) {
        byte input = 125;
        Byte data = new Byte(input);
        int result = data.compareTo(128);
        System.out.println(data + " " + result);
    }
}


125 253
125 -3
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