What is the result?

Given:


What is the result?
A. 0
Done
B. First Exception
Done
C. Second Exception
D. Done
Third Exception
E. Third Exception

Download Printable PDF. VALID exam to help you PASS.

One thought on “What is the result?

  1. E is the correct answer.

    public class Test{
    static void dispResult(int[] num){
    try{
    System.out.println(num[1] / num[1] – num[2]);
    }catch(ArithmeticException e){
    System.err.println(“first exception”);
    }
    System.out.println(“Done”);
    }
    public static void main(String[] args){
    try{
    int [] arr = {100, 100};
    dispResult(arr);
    }catch(IllegalArgumentException e){
    System.err.println(“second exception”);
    }catch(Exception e){
    System.err.println(“third exception”);
    }
    }
    }

    // Output: third exception

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.