Question: Examine this code for doing some things: static void doEverything() { doThings InOrder(); } static void doThings In Order() { try { for (Thing t

 Examine this code for doing some things: static void doEverything() {

doThings InOrder(); } static void doThings In Order() { try { for

Examine this code for doing some things: static void doEverything() { doThings InOrder(); } static void doThings In Order() { try { for (Thing t : ALL_THE_THINGS) { doTheThing(t); } } catch (ThingException te) { return; } } static void doTheThing(Thing t) throws ThingException { // ... 1/ ... maybe go off the end of an array } ThingException is an unchecked exception. Which exceptions could be thrown by a call to doEverything? ArrayIndexOutOfBoundsException 10Exception OOOOO NullPointerException ThingException OutOfMemory Error What might happen if doTheThing throws a ThingException in that code? The program might crash OOO We might fail to call doTheThing on all of the Thing objects in ALL_THE_THINGS We might call doTheThing multiple times on some Thing object(s)

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!