Home » JAVA Programming » Exceptions » Question
  1. What is the output of this program?
    public class exception_handlingExample 
    {
    public static void main(String args[])
    {
    try
    {
    int num = 10;
    for (int k = -1; k < 3 ;++k)
    num = (num / k);
    }
    catch(ArithmeticException e)
    {
    System.out.print("0");
    }
    System.out.print(num);
    }
    }
    1. 10
    2. 3
    3. Compilation Error
    4. Runtime Error
    5. None of these
Correct Option: C

None of these



Your comments will be displayed only after manual approval.