why is reference type can be different from object type in java
<pre><code>class Animal {

}

class Horse extends Animal {

}

public class Test {
    public static void main(){
        Animal a = new Horse();//mark1
    }
}


Animal ah = new Horse();// reference type is Animal and object is Horse
</code></pre>

<p>I can't fully understand this below:
<strong>Animal ah = new Horse();// reference type is Animal and object is Horse</strong><br>
I always keep the reference type the same with the object<br>
I want to know the reason of using the <em>not-same</em> reference type.Please tell me some condition that it's more appropriate to use it</p>
