Menu
Question Index
...

What will be the output of the following program?

public class WrapperMethods {
    public static void main(String[] args) {
        Short s = 360;
        Short data = new Short(s);
        System.out.println(data.compareTo(s));
        System.out.println(data.equals(s));
        System.out.println(Short.decode("+256"));
    }
}


0
true
256
true
true
256
0
true
+256
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