title: Can i call child class method using parent object?
body: <p>I have created base class animal and child class as cat.
  In main, I want to create obj of PARENT class and call the method of child class.
  So, is it possible or not? 
  I have also used <code>instanceOf</code> to just check relationship</p>
  
  <pre><code>public class Animal
  {
  public void eats()
  {
      System.out.println("Animal Eats");
  }
  }
  
  
  
  public class Cat extends Animal
  {
      public void walks()
      {
          System.out.println("Cat Walks");
      }
  
  }
  
  
  
  public class AnimalMain 
  {
  public static void main(String args[])
  {
  Animal a=new Animal();
  display(a);
  }   
  public static void display(Animal a)
  {
      a.eats();
      if(a instanceof Cat)
      ((Cat)a).walks();  
  }
  }
  </code></pre>