Java, generics and PECS: still having trouble understanding the C part; concrete example?
问题 I'll post a single link here: Collections.sort(). There have been many posts on SO with regards to the PECS paradigm, including this one. In my own personal code, I use generics quite a lot, but have only ever had the use of the P part (that is, <X extends SomethingElse> ). Collections.sort expects as its generics argument a <T extends Comparable<? super T>> . I fail to see where the super kicks in in there. Do you have a concrete example of why this is necessary? While I am at it, I am