Hi, I am trying to write a catch, try block to ask user to enter number between 1-5 and if number outside these values it would provide error and ask user to input again. The problem this is not correct I get error "missing return statement" any help? thanks
James Newbie wrote:ok thanks so done this now and it seem to compile without problems
It may compile but I doubt that it works the way it should. Why did you move the while statement inside the try block? The statement that can throw a NumberFormatException is the parsing of a string to an integer value but I don't see that in your new code.