Debugging with Eclipse - Tutorial by Lars Vogel[
^]
When
String search = scanner.nextLine();
produces an Exception, then must
scanner == null
or
scanner.nextLine() == null
.
A Short look in the debugger would give you the answer.
you can
- use try/catch
- use an if-statement
- make sure the data is not null
Have fun!