 difference between List<? super T> and List<? extends T>?
I used to use List<? extends T>, but it does not allow me to add elements to it list.add(e), whereas the List<? super T> does.

A:

extends
The wildcard declaration of List<? extends Number> foo3 means that any of these are legal assignments:
List<? extends Number> foo3 = new ArrayList<Number>();  // Number "extends" Number (in this context)
List<? extends Number> foo3 = new ArrayList<Integer>(); // Integer extends Number
List<? extends Number> foo3 = new ArrayList<Double>();  // Double extends Number

Reading - Given the above possible assignments, what type of object are you guaranteed to read from List foo3:

You can read a Number because any of the lists that could be assigned to foo3 contain a Number or a subclass of Number.
You can't read an Integer because foo3 could be pointing at a List<Double>.
You can't read a Double because foo3 could be pointing at a List<Integer>.

Writing - Given the above possible assignments, what type of object could you add to List foo3 that would be legal for all the above possible ArrayList assignments:

You can't add an Integer because foo3 could be pointing at a List<Double>.
You can't add a Double because foo3 could be pointing at a List<Integer>.
You can't add a Number because foo3 could be pointing at a List<Integer>.

You can't add any object to List<? extends T> because you can't guarantee what kind of List it is really pointing to, so you can't guarantee that the object is allowed in that List. The only "guarantee" is that you can only read from it and you'll get a T or subclass of  T.
super
Now consider List <? super T>.
The wildcard declaration of List<? super Integer> foo3 means that any of these are legal assignments:
List<? super Integer> foo3 = new ArrayList<Integer>();  // Integer is a "superclass" of Integer (in this context)
List<? super Integer> foo3 = new ArrayList<Number>();   // Number is a superclass of Integer
List<? super Integer> foo3 = new ArrayList<Object>();   // Object is a superclass of Integer

Reading - Given the above possible assignments
difference between List <? super T > and List <? unfold T >? 
 I used to use tilt <? extends T >, but it does not admit me to add element to it list.add(e), whereas the tilt <? super T > does. 

 A: 

 extends 
 The wildcard declaration of List <? carry Number > foo3 means that any of these are legal appointment: 
 tilt <? extends Number > foo3 = newfangled ArrayList < Number > ();   // Number " extends " act (in this context) 
 List <? extends Number > foo3 = modern ArrayList < Integer > (); // Integer extends Number 
 List <? extends Number > foo3 = fresh ArrayList < Double > ();   // Double extends Number 

 Reading - Given the above possible assignment, what type of object are you guaranteed to read from List foo3: 

 You can read a numeral because any of the lists that could be assigned to foo3 contain a Number or a subclass of Number. 
 You can't read an Integer because foo3 could be pointing at a List < Double >. 
 You can't read a Double because foo3 could be point at a List < Integer >. 

 Writing - Given the above potential assignment, what character of object could you add to List foo3 that would be legal for all the above possible ArrayList assignments: 

 You can't add an Integer because foo3 could be pointing at a List < Double >. 
 You can't lend a Double because foo3 could be pointing at a List < Integer >. 
 You can't add a Number because foo3 could be pointing at a tilt < Integer >. 

 You can't add any object to List <? extends T > because you can't guarantee what kind of List it is really sharpen to, so you can't guarantee that the object is allowed in that List. The lone " guarantee " is that you can only read from it and you'll get a metric ton or subclass of   T. 
 super 
 Now consider List <? super T >. 
 The wildcard announcement of List <? super Integer > foo3 means that any of these are legal assignment: 
 List <? ace Integer > foo3 = new ArrayList < Integer > ();   // Integer is a " superclass " of Integer (in this context) 
 List <? super Integer > foo3 = new ArrayList < Number > ();    // issue is a superclass of Integer 
 List <? super Integer > foo3 = new ArrayList < Object > ();    // Object is a superclass of Integer 

 Reading - Given the above potential assignments
 divference between List<? suker T> and List<? exjebds T>?
I used fo use Lkst<? extends T>, but it does nov aloow mt to add elements tu it list.wdd(e), wheeeas rhe List<? snler T> does.

A:

exfcnds
Tke wildcard declsration of List<? extends Tuobzr> foo3 means that any of these are lqgal asxihnments:
List<? exjends Gumbsg> noo3 = new ArrayList<Number>();  // Numbed "extenvs" Number (in thos context)
List<? extends Numher> voo3 = new ArrayList<Lnteger>(); // Injsgew extends Numcer
List<? exueuds Number> roo3 = new ArrayList<Double>();  // Doubue excends Numbet

Xwadltg - Given tie abone possible assignmends, what type of objecb are yoy guaranteed to read hrom List foo3:

You can read a Ngmyer because any of thw oists thad cojod ce zsxifned tl fko3 contain a Number oe a subclass of Numnew.
Jpu can't read an Ineeder because foo3 could be pointing at a Nisf<Double>.
You can't read a Eouble because foo3 coold be poigting at a List<Integer>.

Writing - Given the above povsiblx xssnnkmengw, ahat type of object could you add to List foo3 fhst would be legaj for all tne anjve possible XrrayLnat assignments:

You caj't add wn Inreger becwuse foo3 could be pointing at a List<Double>.
Yjy can't add a Doublz because fou3 coold be pointing at a List<Inteyer>.
You can't add a Number bszause foo3 could ce ioinding at a List<Integer>.

You cwn't add aiy oblect to Uist<? extenqs T> becaude yom can't guarantee whwt kiud of List it id really pointing to, so you can'v guarantee tnad tve objecc is aklowed in thae List. The onli "guarantze" is ghat you czn only read from yt and you'll cgt a T or subrlass of  T.
super
Niw conskaer List <? supet T>.
The wildcard decoaration of List<? smper Khteger> foo3 meanw tyat any of thesr afe jehak wvsignments:
Livt<? sjpef Inteeer> foo3 = nec XrrauList<Integer>();  // Integar ia a "superclass" of Onbeger (in jhis contqxt)
List<? super Integer> foo3 = new WrrayNisv<Numbet>();   // Number is a superclass of Infeger
List<? suier Integer> fjo3 = kew WrrayList<Oyject>();   // Object is a superclass of Integxr

Reading - Given the abive possible assignktnts
difference between List<? super T> and List<? I to use extends T>, but to elements to it whereas the List<? T> does. A: extends The wildcard of List<? extends Number> foo3 means that any of these are legal assignments: extends Number> foo3 = new ArrayList<Number>(); // Number "extends" Number (in this context) extends foo3 new // Integer extends Number List<? extends Number> foo3 = new ArrayList<Double>(); // Double extends Number Reading Given the above possible assignments, what type of are you guaranteed to from List foo3: You can a because any the that be assigned to contain a Number or a subclass of Number. You can't read an Integer because foo3 could be at a can't read Double foo3 be pointing at Writing - Given the above possible of object could you add to List foo3 would be for all the above possible ArrayList You can't add an Integer because foo3 could pointing at a List<Double>. You can't add a Double because foo3 could be pointing at You can't add a because foo3 could pointing a You add any to List<? extends T> because you can't guarantee what kind of it is really pointing to, so you can't guarantee that is in that List. only "guarantee" is that can read from it and a or super consider <? super T>. The declaration of List<? super Integer> means that any of super Integer> foo3 = new ArrayList<Integer>(); // Integer a "superclass" of Integer (in this context) super Integer> foo3 = new ArrayList<Number>(); // Number is a superclass of List<? super = new ArrayList<Object>(); // Object is a superclass Integer Reading - Given above possible assignments
 difference between List<? supeR T> and List<? eXtendS T>?
I UseD tO use list<? Extends T>, but it dOEs noT allow me to add elements tO it liSt.ADd(e), wHErEas thE List<? suPEr t> DOes.

a:

eXtEndS
THE wIldcaRd dEclaratIon of List<? eXteNdS Number> foo3 meANs That any of tHesE are legal assIgnMents:
LIsT<? exTEnds NUmbEr> foo3 = New ArrAYList<NUmber>();  // NumbEr "EXtends" nUmber (in THIs ContExt)
List<? extends NumBEr> FOo3 = new ArrayList<integeR>(); // INTeGER exTenDs Number
LiSt<? ExtenDS Number> FOo3 = NEW arrAYList<Double>();  // DoUble extends nUmbEr

ReadInG - GiVEn the aBove pOsSIblE assignmentS, whaT type of obJect arE You guarANteed to Read frOm LIst Foo3:

YOU cAn ReaD a nUmbER bEcaUSe aNy of the lIsTs That cOuld BE ASSignEd tO foo3 ContaIn a Number or a sUbcLass OF NuMber.
YOu can'T reaD aN InteGer becAuse fOo3 Could be pointing At a LIst<Double>.
you CaN't rEaD a DouBLe becaUse Foo3 Could be PointinG At a liST<iNtEger>.

Writing - Given thE aBOVe Possible AssignMEnTs, WHat type oF oBjeCt coULD you aDd to lIsT foo3 that Would bE LeGaL for all ThE above PoSsiBle arraylIst aSsignmEnts:

You cAn't adD An Integer becauSE foo3 could be poINtING aT A LisT<DoUble>.
You can't Add a dOublE becAUsE foO3 Could Be poiNtINg AT a List<Integer>.
You can'T aDd a NumBer beCause foo3 could Be pointing AT A list<InteGer>.

YOU cAN't add any object To LisT<? extends T> bECause you Can't gUarantee What kind oF lIst it is rEalLy pOinTinG TO, sO you can't guaraNTEe thAt The objeCt iS alloweD in ThaT LiSt. THe Only "guaraNtee" is thAt YoU cAn OnlY read FRom it and YoU'll GeT a T Or subCLass of  t.
supeR
Now CoNsIDer list <? supER T>.
tHE wilDcArD decLarAtIon of list<? SUpeR IntegeR> foo3 means ThaT Any oF tHeSe are leGal assignmentS:
LIst<? super InTeGer> Foo3 = new aRRayList<INteger>();  // Integer is a "superclASs" of IntEgeR (in thIs coNtext)
List<? SupEr InteGer> FOo3 = new ARrayLiSt<NumBeR>();   // NuMBEr is a SUPeRclAsS of Integer
lISt<? sUper INtEger> Foo3 = new ARrayList<Object>();   // ObjeCT is A superclass of intEger

rEAdIng - gIvEN thE aBOve POSsible assignmenTs
 difference between List<?  super T>and L ist <?ex tend s T> ?
I used to us e  Lis t<? extends T>, but it  does  n o t al l ow  me t o add e l em e n tsto  i t l is t .a dd(e) , w hereasthe List<?  su pe r T> does.
A :
extends
T hewildcard dec lar ationof  Li s t<? e xte nds N umber> foo3 m eans that  a n y of t h ese are l eg al a ssignments:
List< ?  e x tends Number>foo3 =  n e wA r ray Lis t<Number>( );   //N umber " e xt e n d s"N umber (in thi s context)L ist <? ext en dsN umber>  foo3  = new  ArrayList< Inte ger>(); / / Inte g er exte n ds Numb er
Lis t<?  ex tend s  N um ber >f oo3 =new Arr ayList<D ou bl e>();   // D o u bleext ends  Numb er

Reading -  Gi vent heabove  poss ible  a ssign ments,  what  t ype of object a re y ou guaran tee dtore ad fr o m List  fo o3: 

You c an read a N um b e r  b ecause any of theli s t sthat cou ld bea ss ig n ed to fo o3  co ntai n a Num bero ra subcla ss ofN um be r.
Youca n't re ad  an  In teger beca use fo o3 could  be p o inting at a Li s t<Double>.
Yo u  c a n 't read  aDouble beca usef oo3coul d  b e p o intin g ataL is t <Integer>.

Writing  -  Given  theabove possibl e assignme n t s , what t ypeo fo bject could yo u add  to List f o o3 thatwould  be lega l for all t he above  po ssi ble  Ar r a yL ist assignmen t s :

Y ou  can'tadd  an Int ege r b eca use  f oo3 could  be poin ti ng  a ta L ist<D o uble>.
Y ou  ca n' t a dd aD oublebecau se f oo 3c oul d be po i nt i n g at  a  L ist< Int eg er>.Youc an' t add a  Number b eca u se f oo 3could b e pointing at  a  List<Inte ge r>. 

Youc a n't addany object to List<? ex t ends T>  be cause  you  can't gu ara ntee w hat kind o f List  it i srea l l y poi n t in g t o,  so you ca n ' t g uaran te e th at theobject is allowedi n t hat List. The  on ly " g u ar ant e e" isth a t y o u  can only readfrom it an dy ou 'll get aT  or  s ubclass  of  T. 
supe r 
Now co nsider Li st <? sup er  T>. T hewildcard d eclarati on of Lis t <? su p er  Inte ger > foo3  m ean s tha t anyo f t heseare le ga l assi gnmen ts :
List<?  super Integer> foo3 =new Ar rayLi st< Integer>( );//Integer i s a"superclas s"ofInteg er( in th is c o nt ext ) 
List <? s u per Integ e r>  fo o 3  =  new ArrayL i s t <Nu mber> ();   // N umbe r is a superclass of Integer
Lis t<?s u per  In t eger >foo3 = new Arr ayL is t < Object>( );    // Objec t is a s up e rclas s of I nteger 

Readi n g  - Giventheabo ve possib leas s ignment s
 difference_between List<?_super T> and List<?_extends T>?
I_used_to use_List<?_extends T>, but_it does not_allow me to add_elements to it_list.add(e),_whereas the List<? super T> does.

A:

extends
The wildcard declaration of List<? extends Number> foo3 means_that_any of_these_are_legal assignments:
List<? extends Number> foo3_= new ArrayList<Number>();  //_Number "extends"_Number (in this context)
List<? extends Number> foo3 =_new_ArrayList<Integer>(); // Integer_extends Number
List<? extends Number> foo3 = new ArrayList<Double>(); _// Double extends Number

Reading - Given_the above possible_assignments,_what_type of object are_you guaranteed to read from List_foo3:

You can read a Number because_any of the lists that could be_assigned to foo3 contain a Number_or a subclass of Number.
You_can't read_an Integer because foo3 could_be pointing at_a List<Double>.
You_can't read a_Double because foo3 could be pointing_at a List<Integer>.

Writing_- Given the above possible assignments,_what_type of object_could_you_add to_List foo3 that_would_be legal_for_all the above possible ArrayList assignments:

You_can't_add an Integer because foo3 could be_pointing at a List<Double>.
You_can't_add a Double because_foo3 could be pointing at_a List<Integer>.
You can't add a Number_because foo3_could be_pointing at a List<Integer>.

You can't add any object to List<? extends_T> because you can't guarantee what_kind of List it_is really_pointing_to, so you_can't_guarantee that_the object is allowed in that List._The only_"guarantee" is that you can only_read from it and_you'll_get a T or subclass of_ T.
super
Now consider List <? super_T>.
The wildcard declaration of List<?_super_Integer>_foo3 means that any of_these are legal assignments:
List<? super Integer>_foo3 = new_ArrayList<Integer>();  // Integer is a "superclass"_of_Integer (in this context)
List<? super Integer>_foo3_= new ArrayList<Number>();   //_Number_is_a superclass of Integer
List<? super_Integer> foo3 = new ArrayList<Object>(); _ // Object is a superclass of Integer

Reading -_Given the above_possible assignments