Foreach through different objects but all implement same interface possible?
<p>Suppose I have this</p>

<pre><code>interface Movable
{//some stuff}
</code></pre>

<p>And I have</p>

<pre><code>class Car implements Movable
{//some stuff}
</code></pre>

<p>And also maybe I have</p>

<pre><code>class Bike implements Movable
{//some stuff}
</code></pre>

<p>I noticed that if I had this:</p>

<pre><code>ArrayList&lt;Movable&gt; movableThings = new ArrayList&lt;Movable&gt;();
movableThings.add(some kind of Car)
movableThings.add(some kind of Bike)
movableThings.add(some kind of Bike)
</code></pre>

<p>This can be called:</p>

<pre><code>for(Movable m: movableThings)
</code></pre>

<p>But if I call this I get incompatible types:</p>

<pre><code>for(Bike b: movableThings)
</code></pre>

<p>Can someone explain, and maybe offer a better way? 
I know I can use foreach Movable m: movableThings and then use instanceof to check for Bikes but is there another way?</p>

<p><strong>Edit:</strong> alright thanks for clarifying guys... so I guess I either use instanceof or redesign my game</p>
