So the s.equals never executes, and scanner doesn't read beyond the last line. I think this program works correctly.