List<Object> c = new ArrayList<>();        
                  
                  
                  Cant understand why we CAN do this:
                  
                  
                  List<? super Number> d = c;
                  
                  
                  But CANNOT do this:
                  
                  
                  List<? extends Number> d1 = c;
                  
                  
                  We have pointed that c is a list of Objects. So why we cant say it is also a List of Integer (which extend Number AND also IS-A Object) ?
                  
                  
                
:)
The super example works because number is a child of object
Обсуждают сегодня