Question: Given the following code segment, what output would be generated? int rupees = 500; String [] inventory = new String[10]; try { inventory[10] = Deku

Given the following code segment, what output would be generated?

int rupees = 500;

String [] inventory = new String[10];

try

{

inventory[10] = "Deku Mask";

rupees -= 100;

}

catch (Exception ex)

{ rupees += 100; }

catch (IndexOutOfBoundsException ex2)

{ rupees -= 200; }

finally

{ rupees += 300; }

System.out.println(rupees);

600

800

900

700

ONE OF THE ANSWERS IS CORRECT

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!