Question: Postponed catch elaboration: Modify this chapters StudentList2 program so that the drivers exception handler displays more than just Invalid entry. Instead, have it display the

Postponed catch elaboration:

Modify this chapter’s StudentList2 program so that the driver’s exception handler displays more than just “Invalid entry.” Instead, have it display the error class and message and the acceptable range of index values. Most of the change will be in the driver class’s catch block, but in your StudentList2 class you’ll want to add a size method that returns the size of the students ArrayList.

Sample session: Caleb Izumi Mary Usha Enter index of student to remove: 4 class java.lang.IndexOutOfBounds

Sample session: Caleb Izumi Mary Usha Enter index of student to remove: 4 class java.lang.IndexOutOfBounds Exception Index 4 out-of-bounds for length 4 Enter an integer between 0 and 3. inclusive Enter index of student to remove: 3 removed Usha Caleb Izumi Mary

Step by Step Solution

3.37 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The question is asking you to modify an existing program StudentList2 in a way that improves the output provided when an exception occurs Specifically ... View full answer

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 Introduction To Programming With Java A Problem Solving Approach Questions!