Home » JAVA Programming » Exceptions » Question
  1. What is the output of this program?
    public class Result 
    {
    public static void main(String args[])
    {
    try
    {
    int p = 0;
    int q = 11;
    int s = q / p;
    System.out.print("Hello");
    }
    catch(Exception e)
    {
    System.out.print("Java");
    }
    }
    }
    1. Compilation Error
    2. Runtime Error
    3. Hello
    4. Java
    5. None of these
Correct Option: D

Java



Your comments will be displayed only after manual approval.