Suppose B class inherits A. Then the following code works.
A ob; ob=new B();
but the following throws an ArrayStoreException :
A ob=new B; ob=new A();
Is ob a reference of type A or B ? In the first code, ob was a reference of type A and therefore was able to hold a reference of a subtype. In the second code also, ob should be able to hold a reference to both A and B