Consider the following codes: 

```
class Super {}
class Sub extends Super {}
class Test {
    public static void main(String[] args) {
        List<? extends Super> list = new ArrayList<Sub>(); //1
        list.add(new Sub()); //2
    }
}

```

Line 1 compiles successfully, but line 2 fails compilation: 

```
The method add(capture#2-of ? extends Super) in the type List<capture#2-of ? extends Super> is not applicable for the arguments (Sub)

```

My questions are:   

1) Why does line 1 successfully compile?   

2) Is line 1 a good practice in declaring a List (or other collections)?   

3) Why does line 2 fail compilation, after list was declared to be type Sub in line 1?   

4) Eclipse's autocompletion says only "null" elements are allowed in list now. Why? 

Thanks a lot!