Good day, I have trouble with understanding a bounding generics in Java. I readed Oracle article about this and write simple code, but he work conversely and i not understand why. Why can not I pass a Float type when putting a restriction on the Number type and its subtypes, even though it is inherited from Number, and when I put the border on the type and its superclasses, then I can pass the type Float, even though Double is not superclass for Number.
// Work
List<? super Number> gen1 = new ArrayList<>();
gen.add(3.14);
// Not work
List<? extends Number> gen = new ArrayList<>();
gen.add(3.14);