Understand List<? Extends t> list, T key, comparator<? Super T> C
These are generally used on method parameter types to accept generic objects.
1, list<? Extends t> represents a subclass of any T, such as list< Extends person> indicates that any generic type can be accepted as a list object of any person subclass, which is generally used for method invocations, which represents each of the accepted list<? The elements in extends person> are all a person and contain the function interface of person.
2, comparator<? Super T> represents the parent class or ancestor of any T, comparator< Super Student> can indicate that accepting any one of the generic types is a comparator of the Student parent class, such as a comparator<person> can sort all the person, Then nature can also give student sort.
Extends and Super keywords in Java generics