I suspect it is due to the way the StdIn.readAll() method works. Read the documentation for that call and see why it might be acting that way. I changed your code to use Scanner and System.out, and...