Menu
Question Index
...

What will be the output of the following program?

public class AbCdEfGh {
    public static void main(String args[]) {
        try {
            Float f1 = new Float("150.0");
            int x = f1.intValue();
            byte b = f1.byteValue();
            double d = f1.doubleValue();
            System.out.println(x + b + d);
        } catch (NumberFormatException e) {
            System.out.println("Wrong number");
        }
    }
}


194.0
278.0
450.0
Wrong number
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