Casting ArrayList<SomeClass> to ArrayList<SomeInterface>
<p>I have 3 classes representing 3 differents things:
<code>Article</code>,
<code>Photos</code>, and
<code>Videos</code></p>

<p>All 3 things have 2 properties in common: 
A <code>title</code> and and <code>image</code>.</p>

<p>I have an <code>interface</code> called <code>ImageTitleListItem</code> that the 3 classes implement.
That <code>interface</code> is just a getter/setter for <code>title</code> and <code>image</code></p>

<p>I have 3 classes that are <code>ArrayList</code>:</p>

<pre><code>Articles extends ArrayList&lt;Article&gt;
Photos extends ArrayList&lt;Photo&gt;
Videos extends ArrayList&lt;Video&gt;
</code></pre>

<p>I have an <code>ArrayListAdapter</code> that display a list of those <code>images</code> with there <code>title</code>.</p>

<p>The constructor of the <code>ArrayListAdapter</code> receive <code>ArrayList&lt;ImageTitleListItem&gt;</code> as a parameter</p>

<p>When I call it :</p>

<pre><code>adapter = new ArrayListAdapter(Articles)
</code></pre>

<p>I have an error: </p>

<pre><code>The constructor ArrayListAdapter(Articles) is undefined
</code></pre>

<p>That's normal, so i tried to cast it:</p>

<pre><code>adapter = new ArrayListAdapter((ArrayList&lt;ImageTitleListItem&gt;)Articles)
</code></pre>

<p>Now the error is: </p>

<pre><code>Cannot cast from Articles to ArrayList&lt;ImageTitleListItem&gt;
</code></pre>

<p>I'm relativly new to java so there's a trick I'm missing, can somebody help me on this.</p>

<p>Thanks</p>
