Sedan[]
is a sub-type of Car[]
. But this has a very negative impact on type safety, because the following code is thus legal:
Sedan[] sedans = new Sedan[10];
Car[] cars = sedans; // legal, since Sedan[] extends Car[]
cars[0] = new Car(); // Houston, we have a problem
This code causes an ArrayStoreException at runtime, because an array supposed to only contain sedans would contain a non-Sedan car.
The goal of generics was to have type-safe collections. And the decision was thus taken to design them so that the above problem would be detected at compile time, rather than runtime. Collections are much more used than arrays, and it's quite a good thing to have them type-safe.
So they decided that a List<Sedan>
would not be a List<Car>
.