You are viewing a single comment's thread. Return to all comments →
If you use the Scanner class, you only need to catch the InputMismatchException and ArithmeticException to pass all the test cases. There is no need for a catch-all Exception.
Using a catch-all Exception clause is generally a bad idea when writing programs.