Menu
Question Index
...

What will be the output of the following program?

public class InfiniteValues{
    public static void main(String args[]) {
        Float d = new Float(1.2 / 1.4);
        Float d1 = new Float(1.2 / 0.0);
        System.out.println(d + " is " + d.isInfinite());
        System.out.println(d1 + " is " + d.isInfinite());
    }
}


0.85714287 is true
Infinity is true
0.85714287 is true
Infinity is false
0.85714287 is false
Infinity is false
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java isInfinite() And isNaN() Methods In Double Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App