Menu
Question Index
...

What will be the output of the following program?

public class UsingLong {
    public static void main(String args[]) {
        Double dub = new Double("12.57689");
        Float flo = new Float("12.56f");
        long lon = dub.longValue();
        long ln = flo.longValue();
        System.out.print(lon + ", " + ln);
    }
}


12.57689, 12.56
12.57689, 12.0
12.0, 12.0
12, 12
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