title: How to add content of the file to an array list
body: <p>I have used <code>BufferedReader</code> to read the content from the file but now I want to store the content of the file into an array list where my file contains some text from the pdf so now I wanted to add all those content to the array list </p>
  
  <p>Here I have created array list but now I don't know how to proceed how to go next and then read from while loop so please help me</p>
  
  <pre><code>        ArrayList&lt;String&gt;YourList=new ArrayList&lt;String&gt;();
          FileReader fr = new 
          FileReader("D:\\PDFTOEXCEL\\Extractionfrompdf.txt");
          BufferedReader br = new BufferedReader(fr);
  
          String s;
  
          String keyword = arra.get(6);
  
          while ((s = br.readLine()) != null) {
              if (s.contains(keyword)) {
                  s = s.replaceAll(keyword, " ");
                  System.out.println(s);
              }
          }
  </code></pre>