title: Java ArrayList missing first value
body: <p>I am taking data from a text file and putting it into an ArrayList. However the first line of the text file is not being printed out.</p>
  <pre><code>public static void secondMain() {
      BufferedReader reader;
      var lines = new ArrayList&lt;String&gt;();
      var rooms = new ArrayList&lt;Room&gt;();
      try {
          reader = new BufferedReader(new FileReader(&quot;rooms.txt&quot;));
          String line = reader.readLine();
          while (line != null) {
              line = reader.readLine();
              lines.add(line);
          }
          
          reader.close();
          
          for (int i = 0; i &lt; lines.size() - 1; i++) {
              String[] words = lines.get(i).split(&quot; &quot;);
              var room = new Room();
              room.RoomNumber = Integer.parseInt(words[0]);
              room.Type = (words[1]);
              room.Price = Double.parseDouble(words[2]);
              room.Bool1 = Boolean.parseBoolean(words[3]);
              room.Bool2 = Boolean.parseBoolean(words[4]);
              room.Availability = (words[5]);
              rooms.add(room);
              
          }
  
  
  
          for(int i = 0; i &lt; rooms.size(); i++) {
              System.out.println(rooms.get(i).RoomNumber);
              System.out.println(rooms.get(i).Type);
              System.out.println(rooms.get(i).Price);
              System.out.println(rooms.get(i).Bool1);
              System.out.println(rooms.get(i).Bool2);
              System.out.println(rooms.get(i).Availability);
                              
          }
  </code></pre>
  <p>Apologies for the Image, it was the only way i could figure out how to show the formatting of the text file.
  <a href="https://i.stack.imgur.com/UQUhG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UQUhG.png" alt="Image of the text file" /></a></p>
  <p>The current output is displaying room number 102 as the first room which obviously isn't correct.</p>
  <p>If anyone could also help me figure out how to format my console output the same way as the text file that'd also be great. currently it is displaying each individual string/int etc. on a different line.</p>
  <p>Thanks.</p>
  <p>If you need any more information please just ask!</p>