Question: Task 4 { { new int [ ] { , 2 , 3 } ; int sum = ; for ( i = 1 ;

Task 4
{
{
new int []{,2,3};
int sum =;
for (i=1;i4;i+t)
{
sum +=arr[i]
}
System.out.println("Sum: "+ sum);
}
catch (Exception e)
f
System.out.println("Exception was caught! ");
}
catch (IndexOutOfBoundsException e)
i
System.out.printin( Index0utOfBounds Exception was caught!");
}
}
A: nothing, the compilation error will occur
B: Exception was caught!
C: IndexOutofBoundsException was caught!
D: Exception was caught!
IndexOutOfBoundsException was caught!
 Task 4 { { new int []{,2,3}; int sum =; for

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!