title: ArrayList and .add() method in java
body: <p>I am writing a program that has to read information from file and put them into ArrayList, I think my code is right but Eclipse is saying :<code>The method add(int, String[]) in the type ArrayList&lt;String[]&gt; is not applicable for the arguments (int, String)</code> about <code>account.add(0, x[0]);</code> in my code.</p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>public static void main(String args[]) {
  
      ArrayList&lt;String[]&gt; account = new ArrayList&lt;&gt;();
      String line = "";
      try {
          FileReader fr=new FileReader("information.txt");
  
          Scanner information = new Scanner(fr);
          while (information.hasNext()) {
  
              // find next line
              line = information.next();
  
              String x[]=line.split("-");
              account.add(0, x[0]);
              account.add(0, x[1]);
              account.add(0, x[2]);
          }
      }
  }
  </code></pre>