title: BufferReader reading empty lines
body: <p>I am entering lines from input (IDE eclipse Luna) on pressing enter the cursor keeps moving down but no output shows up. In tried second method but i have to press enter twice to print output how can i fix both errors . Why in second method as soon as it detects blank line it doesn't print why i have to press enter twice  And what commands goes when we press enter in console</p>
  
  <p><strong>FIRST METHOD</strong></p>
  
  <pre><code>private static String para = null;
  public static void main(String[] args) throws IOException {
      BufferedReader bufferedReader = new BufferedReader(
              new InputStreamReader(System.in));
      String line;
      while ((line = bufferedReader.readLine()) != null) {
          para = para + line;
      }
      bufferedReader.close();
      System.out.println(para);
  }
  </code></pre>
  
  <p><strong>SECOND METHOD</strong></p>
  
  <pre><code>String line;
      while (!(line = br.readLine()).equals("")) {
          s1 = line.split(" ");
          for (int j = 1; j &lt; s1.length; j++) {
              int m = Integer.parseInt(s1[j]);
              edges[Integer.parseInt(s1[0]) - 1].add(vertices[m - 1]);
          }
  
      }
  </code></pre>