title: What is a line buffered in Java?
body: <p>I'm having a little problems about Java input.
  My code is a guessing letter game.(I read it from a book.)
  Here's my code.</p>
  
  <pre><code>public class Guess4 {
      public static void main(String args[])
      throws java.io.IOException{
          char ch, ignore, answer = 'K';
  
          do{
              System.out.println("I'm thinking of a letter between A and Z.");
              System.out.print("Can you guess it : ");
  
              ch = (char) System.in.read();
  
              do{
                  ignore = (char) System.in.read();
              }while(ignore != '\n');
  
              if(ch == answer) System.out.println("** Right **");
              else{
                  System.out.print("...Sorry, you're ");
                  if(ch&lt;answer) System.out.println("too low.");
                  else System.out.println("too high.");
                  System.out.println("Try again!\n");
              }
          }while(answer != ch);
      }
  </code></pre>
  
  <p>I do not understand why this block of codes is necessary.</p>
  
  <pre><code>do{
      ignore = (char) System.in.read();
  }while(ignore != '\n');
  </code></pre>
  
  <p>When this block is deleted. The output came out differently.</p>
  
  <p>The book did said something about the line buffered but I still don't understand.
  Can anyone explain what a line buffered is?</p>
  
  <p>Thank you.</p>