Menu
Question Index
...

What will be the output of the following program?

public class FireFox {
    public static void main(String s[]) {
        Float fire = new Float(Float.NaN);
        Float fox = new Float(Float.NaN);
        System.out.print((fire == fox) + " ");
        System.out.print(fire.equals(fox) + " ");
        System.out.print(Float.NaN == Float.NaN);
    }
}


false false false
true true true
true false true
false true false
Some other output
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