title: Why reference variable of type object must be cast when used as other object type
body: <p>Although all classes in Java are sub-classes of Object class, but different from other object types, a reference variable of type Object can't be assigned to any other reference type without a cast.</p>
  
  <p>For example:</p>
  
  <pre><code>public class Inheritance {
  
      public static class Animal {        
          public void Scream() {
              System.out.println("I'm an animal");
          }       
      }
  
      public  static class Mammal extends Animal{
          public void Scream(){
              System.out.println("I'm a mammal");
          }       
      }
  
      public  static class Tiger extends Mammal{
          public void Scream(){
              System.out.println("I'm a tiger");
          }       
      }
  
      public static void main (String[] args){
  
          Animal tiger = new Tiger();
          tiger.Scream(); //true
  
          Object tiger = new Tiger();
          tiger.Scream(); //false
  
          Object tiger = new Tiger();
          ((Animal) tiger).Scream(); //true
  
      }
  
  }
  </code></pre>