I have read O'Reilly book, in that I came to know this get-put principle.
- Use an
extendswildcard when you only get values out of a structure.- Use a
superwildcard when you only put values into a structure.- And don't use a wildcard when you both want to get and put from/to a structure.
Exceptions are:
You cannot put anything into a type declared with an
extendswildcard except for the valuenull, which belongs to every reference type.
You cannot get anything out from a type declared with an
superwildcard except for a value of typeObject, which is a super type of every reference type.
Can anyone help me to explore this rule at depth? If possible, please put them hierarchical manner.
 
     
    