
Write an application that prompt the user to enter a number to use as an array size, and then attempt to declare an array using the entered size. Java generates a NegativeArraySizeException if wou attempt to create an array with a negative size, and a NumberFormatException if you atempt to create an array using a non-numeric value for the size. Use catch block that executes if the array size is nonnumeric or negative, displaying a message that indicates the array was not created. If the array is created successfully, display an appropriate message and then prompt the user to store values in the array. At the end of your program ask the user to enter the index of the array to display the element value. Create a catch block that catches the eventual ArrayIndexOutOfBoundsException, so if the user attempts to access an element out of the range of the array display the message Now you have gone so far!! .
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.