Implement the program given in self-test question 4 above. Now: (a) Re-write main so that it catches any exceptions it may now throw by displaying a message on the screen indicating the exception...

Implement the program given in self-test question 4 above. Now: (a) Re-write main so that it catches any exceptions it may now throw by displaying a message on the screen indicating the exception thrown. (b) At the moment, the “End of program” message may not always be executed. Add an appropriate finally clause so that this message is always executed at the end of the program. (c) Add an additional catch clause in main to catch any unaccounted-for exceptions (within this catch clause print out the stack trace of the exception). (d) Create your own exception class InvalidPositionException (make this an unchecked exception). (e) Re-write the display method so that it throws the InvalidPositionException. (f) Re-write main to take account of this amended display method. (g) Document these exceptions using appropriate Javadoc comments.
Nov 22, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here