To add to Hikaros' explanation:

Imagine keyboard input (System.in) as being stored in a buffer. Every key pressed by the user is added to the buffer, including the Return or linefeed. Most of...