It just means that the list can point towards any reference of super-type but addition is only allowed for
object of class B or sub-classes of B.
Am i right?
So the list can contain only the reference of class B or subclasses of B.
public List go(List<? super B> la
The list reference passed to the method can be any super type of B or B itself but the objects
that can be added to the collection can only be either B or sub-class of B.
Then why we pass the reference as <? super B>.Why don't we pass reference as<B>?
ujjawal rohra wrote:Hii Prithvi
I havent got any schedule ..When i give a mock i catch my weakness on
a topic then start practising on it.Then again the same thing happens.
Additionally i am unable to concentrate for some days
If you are talking about the method signature, then it's generics way to let you add something
into a collection in a safe-way.
Ya.I aggree with you.But if we pass <B> instead of <? super B> also a safe-way. Am i right or not?