Question: Write an application named GoTooFar in which you declare an array of five integers and store five values in the array. Write a try

Write an application named GoTooFar in which you declare an array of five integers and store five values in the array. Write a try block in which you loop to display each successive element of the array, increasing a subscript by 1 on each pass through the loop. Create a catch block that catches the eventual ArraylndexOutOfBoundsException and displays the message, Now you've gone too far." Save the file as GoTooFar.java.
Step by Step Solution
3.31 Rating (148 Votes )
There are 3 Steps involved in it
simple include done true after the systemoutprint statement this will stop after the fir... View full answer
Get step-by-step solutions from verified subject matter experts
