title: How to declare a multiple arraylist in java
body: <p>I have a problem to declare a mulitple arraylist.
  ... missing the correct syntax or mixed up my mind ...</p>
  
  <p>This works fine till here, to declare an arraylist with an array:</p>
  
  <pre><code>Integer[] arrArray = new Integer[] {1,2,3,4,5};
  ArrayList&lt;Integer&gt; arrList = new ArrayList&lt;Integer&gt;();
  arrList.addAll(Arrays.asList(arrArray));
  </code></pre>
  
  <p>also initailising and declaring in one line :</p>
  
  <pre><code>Integer[] arrArray = new Integer[] {1,2,3,4,5};
  ArrayList&lt;Integer&gt; arrList = new ArrayList&lt;Integer&gt;(){{
  addAll(Arrays.asList(arrArray));}};
  </code></pre>
  
  <p>or by element :</p>
  
  <pre><code>ArrayList&lt;Integer&gt; arrList = new ArrayList&lt;Integer&gt;(){{
  add(1);
  add(2);
  add(3);
  }};
  </code></pre>
  
  <p>But now I would like to do the same thing, but now with multiple dimension arraylists (and Strings in this case):</p>
  
  <pre><code>private String[] arrFUSE={"3", "true", "0", "FUSE"};
  private String[] arrPLACE={ "2", "true", "7", "PLACE"};
  private ArrayList&lt;ArrayList&lt;String&gt;&gt; arrLIST = new ArrayList&lt;ArrayList&lt;String&gt;&gt;(){{
  add( Arrays.asList(arrFUSE) );
  add( Arrays.asList(arrPLACE) );
  }};
  </code></pre>
  
  <p>An other try</p>
  
  <pre><code>private ArrayList&lt;ArrayList&lt;String&gt;&gt; arrLIST = 
          new ArrayList&lt;ArrayList&lt;String&gt;&gt;(){{
              add(     
                    new ArrayList&lt;String&gt;(){{ addAll(Arrays.asList(arrFUSE))}};
              );
  }};
  </code></pre>
  
  <p>Thanks on beforehand.</p>