I'm working on a program that takes in book records in the form
<book #>,<name>,<publisher>
for example
123,Example Book,Publisher
After which, the user is returned to a menu, using numbers to select what option they would like.
i get an java.util.InputMismatchException
on this menu, whenever the string is taken in with a space. such as in the example above with 'Example Book'. whereas if it were 'ExampleBook' i would get no such error.
Is there some other way to get the input?
For the string I've been using keyboard.next()
, which doesn't pick up the \n
and i think that may be the problem.