Menu
Question Index
...

What will be the output of the following program?

public class Comparison {
    public static void main(String args[]) {
        float f1 = 30.5f;
        Float f2 = new Float(36.5);
        int l = Float.compare(f2, f1);
        System.out.print(l);
    }
}


1
-1
6
Some other output
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