title: Java Inheritance Question
body: <p>I Have something similar to this setup:</p>
  
  <pre><code>public class Base {
      public String getApple() {return "base apple"};
  }
  
  public class Extended extends Base{
      public String getApple() {return "extended apple"};
  }
  </code></pre>
  
  <p>Somewhere else in the code I have this:</p>
  
  <pre><code>{
      Base b = info.getForm();
  
      if (b instanceof Extended){
          b = (Extended) b;
      }
  
      System.out.println(b.getApple()); // returns "base apple" even when if clause is true why??
  
  }
  </code></pre>
  
  <p>How do I accomplish that?</p>