Question: Fill in the blanks in the code below so that, when the code runs, its output is: 1) got null pointer 2) got illegal array
Fill in the blanks in the code below so that, when the code runs, its output is:
1) got null pointer
2) got illegal array store
3) got illegal class cast
public class TestExceptions {
public static void main (String [ ] args) {
________________ ;
try {
________________ ;
} catch (NullPointerException e) {
System.out.println ("got null pointer");
}
try {
________________ ;
} catch (ArrayStoreException e) {
System.out.println ("got illegal array store");
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
