title: ArrayList to Object[][]
body: <p>I need to convert an Array List to Object[][], I have tried several different methods, and all seem to toss up an error or two.</p>
  
  <p>My latest try is this:</p>
  
  <pre><code>Object[][] array = dataList.toArray(new Object[dataList.size()][]);
  </code></pre>
  
  <p>This throws the following error:</p>
  
  <pre class="lang-none prettyprint-override"><code>java.lang.ArrayStoreException
      at java.lang.System.arraycopy(Native Method)
      at java.util.ArrayList.toArray(Unknown Source)
  </code></pre>
  
  <p>My array list is populated with classes I made, this is the class:</p>
  
  <pre><code>class dataClass {
      int x;
      int y;
      int z;
      String string1;
      String string2;
      Date date;
      int event;
  
      public dataClass(int x, int y, int z, String string1, String string2,
              Date date, int event) {
          this.x = x;
          this.y = y;
          this.z = z;
          this.string1 = string1;
          this.string2 = string2;
          this.date = date;
          this.event = event;
      }
  }
  </code></pre>
  
  <p>This is how I initialize my array list:</p>
  
  <pre><code>public static List&lt;dataClass&gt; dataList = new ArrayList&lt;dataClass&gt;();
  </code></pre>
  
  <p>I then add my new dataClass via:</p>
  
  <pre><code>.add(new dataClass(...));
  </code></pre>
  
  <p>Any help would be great, thanks.</p>