title: Cannot return subclasses of abstract class in implementations of an abstract method
body: <p>I have two sub-classes of an abstract class which each implement an abstract method of their superclass. I want to have a different return type for each, though those return types are in turn sub-classes of a different abstract class. See below:</p>
  
  <pre><code>public abstract class Gardener {
  
      public abstract ArrayList&lt;Flower&gt; getFlowers();
  }
  
  public class GardererA extends Gardener {
  
      public ArrayList&lt;Flower&gt; getFlowers() {
          return new ArrayList&lt;Daisy&gt;();
      }
  }
  
  public class GardererB extends Gardener {
  
      public ArrayList&lt;Flower&gt; getFlowers() {
          return new ArrayList&lt;Rose&gt;();
      }
  }
  
  public abstract class Flower {}
  
  public class Daisy extends Flower {}
  
  public class Rose extends Flower {}
  </code></pre>
  
  <p>Obviously Java won't let me do this, but I'm at a loss for how to get this functionality. Any ideas?</p>