Most programmers do NOT expect a NPE. They add code to test ALL data that is read and to handle all cases that they can think of. Bad input is very common and should be handled in the main code, not...
Type: Posts; User: Norm
Most programmers do NOT expect a NPE. They add code to test ALL data that is read and to handle all cases that they can think of. Bad input is very common and should be handled in the main code, not...
Could you make a version of your code that uses the Scanner class with a String defining the input so that others could test the code without having to go to console mode and spoon feed the program...
Add a printStackTrace to see exactly where the error is occurring.