Menu
Question Index
...

What is the output of the following program?

public class ErrorTest {
    public static void main(String[] args) {
        float f = 90;
        char i = 0;
        try {
            float d = f / i;
            System.out.println(d);
        } catch (Exception e) {
            System.out.println("Exception");
        }
    }
}


Exception
Infinity
Compilation Error
Throws NumberFormatException
Throws some other Exception

Doubts

Problems

Topic: Try Catch Block In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App