> I keep getting this error in my program, but there no errors in the code? Exception in thread "main" java.util

I keep getting this error in my program, but there no errors in the code? Exception in thread "main" java.util

Posted at: 2014-12-18 
Your question contradicts itself. You say there are no errors in your code. But that can't be true, because your code is throwing a runtime exception that you aren't expecting. Unless you have stumbled across a Java bug (which almost never happens, so you never start with that assumption), then the error is in your code. It is a run time error, not a compile time error, but it is still an error in your code.

The first thing you need to do is read the documentation for the error. That will give you a really good idea what the source of the problem is (see link). The next thing you do is look at the stack dump you get when the error happens, and use it to determine exactly which line of code has a problem.

The docs say:

"Thrown by a Scanner to indicate that the token retrieved does not match the pattern for the expected type, or that the token is out of range for the expected type."

So, you have a Scanner object, and you are asking it for some input, but the user entered stuff on the keyboard (the token) that doesn't match what you are expecting. Yup, that is an error in your code. Users enter stuff you aren't expecting all the time, you have to deal with that. You aren't.

Without seeing the actual code, and knowing what the input was, we can't really help you beyond that. If you still need help, post a snippet of the code and the input you used.