Menu
Question Index
...

What will be the output of the following program?

public class WrapperConstructors {
    public static void main(String[] args) {
        String value = "200";
        short s = 128;
        int i = 129;
        Short input = new Short(s);
        Short input1 = new Short(value);
        Integer data = new Integer(i);
        Integer data1 = new Integer(value);
        System.out.println(input + " " + input1);
        System.out.println(data + " " + data1);
    }
}


128 200
129 200
129 200
128 200
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