Create a program-array of five integers


Discuss the below:

Q: Create a program named GoTooFar in which you declare an array of five integers and store five values in the array. Initialize a subscript to zero. Create a try block in which you access each element of the array, subsequently increasing the subscript by 1. Create a catch block that catches the eventual ArrayIndexOutOfBoundsException, and then print to the screen the message, "Now you've gone too far." Save the program as GoTooFar.java

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Create a program-array of five integers
Reference No:- TGS01934895

Now Priced at $20 (50% Discount)

Recommended (93%)

Rated (4.5/5)