This content has been marked as final. Show 2 replies
Your Integer.parseInt(test) is generating this exeption, because "Exit" is not a number and cannot be converted to an Integer.
To fix this problem, you can check if the input string is "Exit" before you try to convert it to an integer. If so, exit gracefully at that point(echo to the user something like 'program finished successfully' first). You may also want to wrap the line that converts the input to an integer in a try/catch block. In the catch block, exit gracefully (echo to the user 'illegal character entered').