Why is SomeClass<? super T> not equivalent to SomeClass in Java generic types?

后端 未结 5 631
清酒与你
清酒与你 2020-12-08 23:52

I noticed the specificaition for Collections.sort:

public static  void sort(List list, Comparator c)

Why

5条回答
  •  感动是毒
    2020-12-09 00:31

    There's a really nice (but twisty) explanation of this in More Fun with Wildcards.

提交回复
热议问题