Java Tree Error
<p>I am trying to implement an array based tree where each node has a list of child nodes and I am getting an error that I need help fixing. </p>

<p>Error: </p>

<pre><code>Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lassign2Trees.ArrayTreeNode;
 at assign2Trees.ArrayTree.&lt;init&gt;(ArrayTree.java:15)
 at assign2Trees.ArrayTree.main(ArrayTree.java:97
</code></pre>

<p>)</p>

<p>The error comes from here I believe:</p>

<pre><code>ArrayTreeNode&lt;E&gt;[] tree = (ArrayTreeNode&lt;E&gt;[]) new Object[1];
</code></pre>
