title: java end of stream using sytem.in.read
body: <p>i just started java and was reading the java a beginners guide here it is mentioned 
  "When reading from System.in pressing ENTER generates an end-of-stream condition"</p>
  
  <p>and that the read method returns -1 when it attempts to read at the end of stream but pressing enter doesn't seem to do anything as read just assigns the value of the \n in Linux and value of \r \n separately in windows. </p>