title: how to read next line in .txt file
body: <p>may i know why i am unable to read next line in a .txt file when i upload it.
  it happens to all the .txt file that i try to upload and then system.out.println() with.
  in my text file it contains : cats,dogs,monkey ( each in one line ) .. but the value out put is: </p>
  
  <pre><code>[Monkey][Monkey, null][Monkey, null, null][Monkey, null, null, null][Monkey, null, null, null, null][Monkey, null, null, null, null, null][Monkey, null, null, null, null, null, null]
  </code></pre>
  
  <p>needs help on this. 
  thank you.</p>
  
  <p>and wondering why i can read .txt file and not .doc. need advise on this as well. </p>
  
  <pre><code>import java.awt.List;
  import java.io.*;  
  import java.util.ArrayList;
  
  import javax.imageio.IIOException;
  import javax.swing.JFileChooser;
  
  public class searchforCapitalLetter {
  
       public static void main(String[] args) throws IOException{  
  
  
            try {  
  
                  // file chooser
                JFileChooser chooser=new  JFileChooser();
              int returnVal = chooser.showOpenDialog(null);{
              if(returnVal == JFileChooser.APPROVE_OPTION)
  
              {   File f = chooser.getSelectedFile();}
              FileInputStream fin = new FileInputStream(chooser.getSelectedFile());
              DataInputStream din = new DataInputStream(fin);    
         BufferedReader br = new BufferedReader(new InputStreamReader(din)); 
  
      ArrayList&lt;String&gt;list =new ArrayList&lt;String&gt; ();
  
      if ((br.readLine()) != null) {
      while (br.readLine() != " ") {
          list.add(br.readLine());
          System.out.print (list);
      } br.close() ;
      }//closes if statement
       } // closes method dialog
                  } // closes try method
  
           catch (FileNotFoundException e) {
                      e.printStackTrace();
                  }     // closes catch method
              } // closes method body
  
  } // closes class method
  </code></pre>