title: Java Polymorphism problem
body: <p>I've learned all these programming terms in Swedish so please bear with me..</p>
  
  <p>I'm having problems calling a method in a subclass which should override a method in the superclass.</p>
  
  <p>Here is the class structure with removed code:</p>
  
  <pre><code>public interface Movable {
      public void move(double delta);
  }
  public abstract class Unit implements Movable, Viewable{
      public void move(double delta){
              System.out.println("1");
      }
  
  }
  public class Alien extends Unit{
      public void move(long delta){
          System.out.println("2");
      }
  }
  public class Player extends Unit{
      public void move(long delta){
          System.out.println("3");
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>public void main(){
      ArrayList&lt;Unit&gt; units = new ArrayList&lt;Unit&gt;();
      Unit player = new Player();
      Unit alien = new Alien();
      units.add(player);
      units.add(alien);
      for (int i = 0; i &lt; this.units.size(); i++) {
          Unit u = (Unit) this.units.get(i);
          u.move();
      }
  }
  </code></pre>
  
  <p>This would output 1 and 1, but I want it to output 2 and 3.<br>
  What am I doing wrong? I thought this was how it worked.</p>