This is because when you use the top border, you cannot add items to the collection, but only read them.
this means that these are some of the tasks:
List<? extends Number> l = new ArrayList<Integer>(); List<? extends Number> l = new ArrayList<Double>();
therefore, you cannot guarantee that when you add an object, it will contain the correct types of objects. for a better explanation, please follow: How to add to the list <? extends number> data structures?
Filip zymek
source share