base class extending and arrays
<p>I want to have a base class and a couple of classes extending it.</p>

<p>Then I want to have an array that could be either of the two extending classes.</p>

<p>I was hoping to do something like this:</p>

<pre><code>class Base{  }
class A extends Base {}
class B extends Base {}
</code></pre>

<p>then I want an array  that could be either A or B so I use Base in array declaration</p>

<pre><code>Base[] it = Base[2];

it[0] = new A();
it[1] = new B();
</code></pre>

<p>I'm not sure if I'm doing this correctly or if this allowed.</p>

<p>Thanks</p>
