Menu
Question Index
...

What will be the output of the following program?

public class Allvalues {
    public static void main(String args[]) {
        Integer it = 10;
        double d = it.doubleValue();
        float fl = it.floatValue();
        long l = it.longValue();
        short k = it.shortValue();
        System.out.print(d + ", " + fl + ", " + l + ", " + k);
    }
}


10.0, 10.0, 10.0, 10.0
10.0, 10.0, 10, 10
10.0, 10.0, 10.0, 10
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Number Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App