What will occur if the catch block in program show below are reversed? class Quiz2H { public static void main(String[] args) { try {
What will occur if the catch block in program show below are reversed?
class Quiz2H
{
public static void main(String[] args)
{
try
{
aMethod();
System.out.println(“After the call”);
}
catch (ArithmeticException exception)
{
System.out.println(“Arithmetic Exception”);
}
catch (RuntimeException exception)
{
System.out.println(“Runtime Exception”);
}
System.out.println(“After the try-catch statement”);
}
private static void aMethod() throws RuntimeException
{
int x = 1/0;
}
}
options:
| Only the RuntimeException will be caught |
| The program will no longer compile |
| The change will have no effect, the program will work the same as before |
| Both exceptions will be caught |