Menu
Question Index
...

What will be the output of the following program?

public class UsingShort {
    public static void main(String args[]) {
        Integer ge = new Integer("123");
        Long flo = 1234567890L;
        short lon = ge.shortValue();
        short ln = flo.shortValue();
        System.out.print(lon + ", " + ln);
    }
}


123, 123
123, 722
123, 721
123, 12345
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Double Class And Java Float Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App