title: Class extends Abstract class implements Interface
body: <p>last weekend i read some stuff about interfaces, abstract classes and design principles. At the end i got a bit confused and i tried to build an example of what i learned (or thought i had learned). </p>
  
  <p>Here is my example:
  The case would be to model a class that holds informations about trees.</p>
  
  <p>First of all i would make an interface:</p>
  
  <pre><code>public interface Tree{
       public void grow();
  }
  </code></pre>
  
  <p>The interface holds all methods that should be implemented by the concrete trees. So far so good but such a tree needs some attributes (variables) that are shared over all tree families. For that purpose i would use a abstract class:</p>
  
  <pre><code>public abstract class AbstractTree implements Tree {
      private String barColor;
      private int maxHeight;
      private boolean isEvergreen;
  }
  </code></pre>
  
  <p>Is this the right way or am i not able to make a kind of contract about attributes (variables) that should be in the other classes?</p>
  
  <p>After the attribute part is done i would like to have 3 type of trees.</p>
  
  <ul>
  <li>Oak </li>
  <li>Maple</li>
  <li>Spruce</li>
  </ul>
  
  <p>So each of these tree "tpyes" can have individual variables.</p>
  
  <pre><code>public class OakTreeImpl extends AbstractTree{
      private String barColor;
      private int maxHeight;
      private boolean isEvergreen;
      private String foo;
      @Override
      public void grow() {
      }   
  }
  </code></pre>
  
  <p>Does this approach sound right in an object-oriented design principles way or am i totally wrong with it?</p>