I wonder if you can help me. I am currently writing an assignment program that needs to do one thing if an integer is entered and another if it is not.
The problem is where i prompt the user for input; if i do enter an integer all is fine but if i don't enter an integer, and just hit enter, the program goes to the next line and hangs until something is entered (an int, and then moves on or a character and then throws an exception).
Any help would be greatly appreciated, i have looked on the net and in my text books but i cant find anything. I am using Scanner for the input.