Question: int [ ] list = { 6 , 2 , 0 , 4 , 3 , 4 } ; int j; try { 1 .

int [] list ={6,2,0,4,3,4} ;
int j;
try {
1. System.out.println ("Try block 1");
for (j =3; j <6; j++){
2. System.out.println (list[3-j]/(j));
}
3. System.out.println("Ending try block 1");
}
catch (ArrayIndexOutOfBoundsException e){
4. System.out.println ("First Exception Caught in block 1: ");
}
catch (Exception e){
5. System.out.println ("Second Exception Caught in block 1: ");
}
finally {
6. System.out.println ("Nothing to declare!");
j =2;
}
try {
7. System.out.println("Try block 2");
8. System.out.println(j / list[j]);
9. System.out.println("Ending try block 2");
}
catch (ArrayIndexOutOfBoundsException e){
10. System.out.println("Exception Caught 2: ");
}
catch (ArithmeticException e){
11. System.out.println("Exception Caught 3: ");
}
12. System.out.println("This is NOT printed!!");
consider the outpot of each statement from 1 to 12+ with explanation please.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!