title: How to return an arrayList of Strings
body: <p>I'm trying to return an ArrayList of userData which is the UserNames of all the users in the Database. I keep getting errors trying to return the ArrayList. Can anyone help?</p>
  
  <pre><code>import java.util.*;
  import java.io.*;
  import java.util.ArrayList;
  
  public class readCSV
  {
      List&lt;String[]&gt; userData = new ArrayList&lt;String[]&gt; ();
      public void checkLogin() throws IOException
      {
          try
          {
              File file = new File("C:/Users/Sean/Documents/Programming assigment/Users.csv");
              BufferedReader bufRdr  = new BufferedReader(new FileReader(file));      
              String lineRead = bufRdr.readLine();
              while(lineRead != null)
              {
                  ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();
                  while(lineRead != null)
                  {
                      this.userData.add (lineRead.split(","));
                  }
                  bufRdr.close();
              }
          }
          catch(Exception er){
              System.out.print(er); 
              System.exit(0);
          }
      }
  
      public String[] getLogin()
      {
          return userData;
      }
  }
  </code></pre>
  
  <blockquote>
    <p>Error imcompatable types</p>
  </blockquote>