forbid us to add something in list
here we are adding t to the output LinkedList , not to the Input . If code is changed to
Then we will get the error as
BackLister.java:8: cannot find symbol
symbol : method add(int,T)
location: interface java.util.List<capture#967 of ? extends T>
input.add(0, t);
^
1 error
Regards
Sunny Mattas
SCJP5