enthuware.ocpjp.v11.2.3097 Need clarification
Posted: Thu Apr 15, 2021 7:59 pm
In theroy associated with this question, it says
List<? super Number> is a sub type of List<? super Integer>.
A. List<? super Number> is a list of Number or its super types.
B. List<? super Integer> is a list of Integer or its super types.
How come A is sub type of B where the object type hierarchy for A is starting from Number (super to Integer) and for B its starting from Integer and yet A is a sub type of B ?
Also, could you pls provide co-relation between the theory n each option given for the question as to why its correct or incorrect and if its incorrect which step(given in theory) its failing at.
Thanks !
List<? super Number> is a sub type of List<? super Integer>.
A. List<? super Number> is a list of Number or its super types.
B. List<? super Integer> is a list of Integer or its super types.
How come A is sub type of B where the object type hierarchy for A is starting from Number (super to Integer) and for B its starting from Integer and yet A is a sub type of B ?
Also, could you pls provide co-relation between the theory n each option given for the question as to why its correct or incorrect and if its incorrect which step(given in theory) its failing at.
Thanks !