Analyze the following code:
```
public class Test {
public static void main(String[] args) {
try {
String s = "5.6";
Integer.parseInt(s); // Cause a NumberFormatException
int i = 0;
int y = 2 / i;
}
catch (Exception ex) {
System.out.println("NumberFormatException");
}
catch (RuntimeException ex) {
System.out.println("RuntimeException");
}
}
}
```
a. The program displays NumberFormatException.
b. The program displays RuntimeException.
c. The program displays NumberFormatException followed by RuntimeException.
d. The program has a compile error.
d. The program has a compile error.
catch (RuntimeException ex) should be specified before catch (Exception ex).
You might also like to view...
To add a button to the Quick Access Toolbar, you must first go to the:
A) DEVELOPER Tab. B) Quick Access Toolbar. C) Add-Ins Tab. D) Backstage view.
After you install Windows, the computer you are working on displays a blue screen of death (BSOD) when rebooting. Which of the following are possible causes?
A. BIOS needs to be flashed to the latest version. B. IRQ conflict. C. Virus in the MBR. D. Incompatible hardware device.