views:

86

answers:

1

I'm not new to java, but I cannot figure out why I get this Scanner error. The code compiles fine, but I get the following runtime error

Enter item number: Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Scanner.java:840) at java.util.Scanner.next(Scanner.java:1461) at java.util.Scanner.nextInt(Scanner.java:2091) at java.util.Scanner.nextInt(Scanner.java:2050) at TestInvoice.getValues(TestInvoice.java:3

+11  A: 

Perhaps change

Scanner scanner = new Scanner("System.in");

to

Scanner scanner = new Scanner(System.in);
ide
I like this one!
willcodejavaforfood
oh such a simple error. you're right