Kertes Gray wrote:The answer is the moment you put a collection with a reference bound(upper-bound), it is now immutable.
Hi Kertes, this is not entirely true though. The collection is mutable, you can sort it, clear it, delete elements at certain indexes from it. You just cannot call add
method on it as the parameter <? extends Bird>
won't take any type of object as a valid argument. The only way to call add
on a List<? extends Bird>
is to do something like this add(new <? extends Bird>())
which obviously is not a valid syntax