title: Converting 'ArrayList<String>' to 'String[][]' in Java
body: <p>How might I convert an 'ArrayList' object to a 'String[][]' array in Java?
  I need a two-dimensional String array and not a simple Array</p>
  
  <p>I Have this file</p>
  
  <p>word1 word1.1 word1.2<br>
  word2 word2.1 word2.2</p>
  
  <p>And I need to have each word to compare with another file</p>
  
  <p>I tried</p>
  
  <pre class="lang-java prettyprint-override"><code>public void Scanne(File file) throws Exception {
  
               Scanner scanner = new Scanner(file);
               ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();
               while (scanner.hasNextLine()) {
                      String line = scanner.nextLine();
                      String[] parts = line.split("\t");
                      String part2 = parts[2];
                      String part3 = parts[3];
                      String part4 = parts[4];
                      String part5 = parts[5];
                      String part6 = parts[6];
                      String part7 = parts[7];
                      String part8 = parts[8];
                      String part9 = parts[9];
                      String part10 = parts[10];
                      list.add(line);
                      String resultSet[][]= new String[list.size()][parts.length];
                      for (int i = 0; i&lt;list.size(); i++) {
                      I am stuck here       
                      }
  }
  '''
  </code></pre>