I guess i confused myself..... This example is like Garage<? super Car> g = new Garage<Car/SUpertype>();
I confused it to to the example given in K&B page 619 where they pass List<Animal> a. reference "a" is passed to a method(List<? super Dog> e) But still a little confusion..... why does it allow as we pass a list<Animal> to a method(list<? super Dog>.)
with raw type object references its not possible as the compiler has no idea which instance it points to or which super type it is going to point to.
I guess i understand a little bit over the problem here..... It is because the V in garage cannot be determined at compile time where as in animal and dog it was determined at compile time that the super of dog is animal.
I really confused myself big time...but i am clear now. When we pass a List<animal> a to a method(List<? super Dog> e)..here we are dealing with references and the compiler knows it. Well if we are talking about List<? super Dog> a = something. compiler really doesn't know what the something object will be that's why we cannot add anything into the list.