开发者

Is <?> higher than all others in the Java wildcard subtype hierarchy?

I'm doing a review for a final tomorrow. I'm being asked to draw the subtype hierarchy of the following types. I want to make sure all the answers I've gotten are correct. I kept in mind generic rules regarding subtypes. Is this correct?

  1. List<?>, List<Integer>, List<Object>, List<Number>, List<? extends Number>, List<? super Number>

  2. Set<Integer>, List<String>, Object, Collection<Integer>, Collection<Object>开发者_如何学C, Collection<?>

My drawing:

Is <?> higher than all others in the Java wildcard subtype hierarchy?


This is actually rather complicated. See http://www.angelikalanger.com/GenericsFAQ/FAQSections/TechnicalDetails.html#FAQ207

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜