title: Storing file in java using arraylist
body: <p>I am reading a file and want to save it in an array list to be able to call this method in another class for later use. 
  Here's my code: </p>
  
  <pre><code>    package com.qmul.rfid.reader;
  import java.io.BufferedReader;
  import java.io.FileReader;
  import java.io.IOException;
  import java.util.ArrayList;
  
  public class ReadFile {
  
          public static void main(String[] args) {
  
              ArrayList&lt;ReadFile&gt; fileList = new ArrayList&lt;ReadFile&gt; ();
  
              try (BufferedReader br = new BufferedReader(new FileReader("C:\\tagNo.txt")))
              {
  
                  String CurrentLine;
  
                  while ((CurrentLine = br.readLine()) != null) {
                      System.out.println(CurrentLine);
  
  
                      fileList.add(CurrentLine);
  
                  }
  
              } catch (IOException e) {
                  e.printStackTrace();
              } 
  
          }
      }
  </code></pre>
  
  <p>I get an error at fileList.add(CurrentLine);. I know this is because CurrentLine does not match with ReadFile. </p>
  
  <p>How can I make this work? </p>
  
  <p>Thank you.</p>