When your reading the string, your asking it to do something, if it cannot do this for some reason, then what action should it take.
You could also use JOptionPanes for it, which are quite a bit more user friendly, (They have a nice little box that pops up and can ask you questions.) but it might be over your head as of now. (Just considering.
)
Although that requires extending javax.swing which if your not sure how to implement things, best leave alone.