I haven't tried to use Scanner with System.in, but my guess would be that the call to nextInt expects a number to be available already, and since there is none, it throws an exception. In other words, the call doesn't wait until there is an int. Have a look at the hasNextInt method to see whether there actually is an int available.
And please
UseAMeaningfulSubjectLine [ January 13, 2007: Message edited by: Ulf Dittmer ]