title: Add subclass objects to an ArrayList
body: <p>I'm about a month into my BSc in Software, and we are working on this forest project where we have different type of trees (ashes and beeches) which grows in different pace. They are subclasses to the general class Tree.</p>
  
  <p>My problem is now I'm asked to add two trees of each kind of tree (ash and beech) to an ArrayList – their <code>int age</code> and <code>double height</code> should all be different. I simply can't put my head around how this should be set up so any advices/hints/solutions is greatly appreciated.</p>
  
  <p>Source for <code>Tree</code></p>
  
  <pre><code>public class Tree{
  
  public int age;
  public double height;
  
  public void growOneYear()
  {
      age++;
  }
  
  public void show()
  {
      System.out.println("Træet er " +age+ " år gammelt og " +height+ " meter højt.");
  }
  }
  </code></pre>
  
  <p>Source for <code>Ash</code> (almost identical to Beech)</p>
  
  <pre><code>public class Ash extends Tree {
  
  public Ash()
  {
      age = 1;
      height = 1.0;
  }
  
  public void growOneYear()
  {
      super.growOneYear();
          if(height &lt; 15){
              height = height*1.20;
          }
  }
  
  public void show()
  {
      System.out.println("Ask: ");
      super.show();
  }
  }
  </code></pre>
  
  <p><a href="http://i.imgur.com/KbBUtb5.png" rel="nofollow">Screenshot of the structure</a></p>