title: how to read even lines in from a file and print in reverse while keeping the odd lines as it is?
body: <p>i want to read even lines from a file and print it in reverse while keeping the odd lines as it is 
  here is the code that i tried which prints all the lines in reverse </p>
  
  <pre><code>import java.io.BufferedReader;
  import java.io.FileInputStream;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.util.ArrayList;
  
  
  public class RevWords
  {
  public static void main(String[] args) throws IOException
  {   
      BufferedReader br = new BufferedReader(new InputStreamReader(new    
      FileInputStream("home.txt"), "UTF-8"));                
  
      String lines = br.readLine();
      ArrayList&lt;String&gt; buffer = new ArrayList&lt;String&gt;();
      while (lines!=null )
  
      {   
  
       if (lines!=null)
  
                       {   
              buffer.add("\n");
  
              StringBuilder str = new StringBuilder();
              String[] splitStr = lines.split(" ");
              for (int i = splitStr.length; i &gt; 0; i--) {
                  str.append(splitStr[i - 1]).append(" ");
              }
  
              buffer.add(str.toString()); 
          }
  
  
          lines=br.readLine();
      }
  
  
      for(int i = buffer.size()-1; i&gt;=0; i--)
      {
  
          System.out.print(buffer.get(i));
      }
  
      br.close();
     }
  }
  </code></pre>
  
  <p>my home.txt is </p>
  
  <pre><code>One reason people lie is to achieve personal power. 
  Achieving personal power is helpful for someone who pretends to be more confident than 
  he really is.
  For example, one of my friends threw a party at his house last month. 
  He asked me to come to his party and bring a date. However,
  I didn’t have a girlfriend. One of my other friends, 
  who had a date to go to the party with, asked me about my date.
  I didn’t want to be embarrassed,
  so I claimed that I had a lot of work to do. 
  I said I could easily find a date even better than his if I wanted 
  I also told him that his date was ugly. I achieved power to help me feel confident; 
  however, I embarrassed my friend and his date. 
  Although this lie helped me at the time,
  since then it has made me look down on myself.
  </code></pre>
  
  <p>my output is </p>
  
  <pre><code>myself. on down look me made has it then since
  time, the at me helped lie this Although
  date. his and friend my embarrassed I however,
  confident; feel me help to power achieved I ugly. was date his that him told als
  o I
  wanted I if his than better even date a find easily could I said I
  do. to work of lot a had I that claimed I so
  embarrassed, be to want didn?t I
  date. my about me asked with, party the to go to date a had who
  friends, other my of One girlfriend. a have didn?t I
  However, date. a bring and party his to come to me asked He
  month. last house his at party a threw friends my of one example, For
  is. really he than confident more be to pretends who someone for helpful is powe
  r personal Achieving
  power. personal achieve to is lie people reason One
  </code></pre>
  
  <p>now how to keep the odd lines at it is and print even lines in reverse</p>