In this assignment modify your Utility class as follows:
- For each method that accepts an argument, if the argument is not valid (methods in the current Utility class should have an indication as to what is valid) throw a new IllegalArgumentException with a message in the format:
methodName: Illegal argument encountered.
To test each method, write a small application class where the method that tests the modified methods catches the exception and displays a JOptionPane error message that displays the message contained in the exception.
The application class should be instantiated from a driver class containing the main() method. The main method should catch any exception and display a JOptionPane error message in the format:
applicationName: Unknown error has occurred. Please contact your system administrator.
- For each query method add a new method that uses an appropriate JOptionPane method rather than a Scanner.
Please Login or Register
to Submit the Solution for the Request