title: Dynamic Binding
body: <p>I would like to know the advantage of <code>Dynamic Binding</code> in java.</p>
  
  <pre><code>public class Animal {
      public String type = "mammal";
  
      public void show() {
          System.out.println("The animal is a: " + type);
      }
  }
  public class Dog extends Animal {  
      public String type;   
  
      public Dog(String type){  
          this.type = type;  
      }  
  
      public void show() {  
          System.out.println("The dog is a: " + type);  
      }  
  }  
  
      public static void main(String[] args) {
          Animal doggie = new Dog("daschund");
          doggie.show(); // "The dog is a: daschund"  (dynamic binding)
          System.out.println("The type is: " + doggie.type); //"The type is: mammal" (static binding)
      }
  </code></pre>
  
  <p>I think, it is a Inheritance strategies. But some people call like Dynamic Binding. That's why, I assume what will be strange in it.</p>