title: How to read a .csv file into an array list in java?
body: <p>I have an assignment for college that requires I take data from a .csv file and read it, process it, and print it in three separate methods.  The instructions require that I read the data into an array list I have written some code to do so but I'm just not sure if I've done it correctly.  Could someone help me understand how exactly I am supposed to read the file into an array list?</p>
  
  <p>my code: </p>
  
  <pre><code>public void readData() throws IOException { 
      int count = 0;
      String file = "bank-Detail.txt";
      try {
          BufferedReader br = new BufferedReader(new FileReader(file));
          String line = "";
          while ((line = br.readLine()) != null) {
  
              bank.add(line.split(","));
  
              String[][] v = (String[][]) bank.toArray(new String[bank.size()][12]);
  
          }
      } catch (FileNotFoundException e) {
  
      }
  }
  </code></pre>