Is it possible to specify both upper and lower bound constraints on type parameters in Java?

后端 未结 3 621
南旧
南旧 2020-12-09 10:12

Is it possible to specify both upper and lower bound constraints on type parameters in Java?

I found a conversation in Sun\'s forum in which this issue was discussed

3条回答
  •  青春惊慌失措
    2020-12-09 10:41

    From Oracle's tutorial:

    Note: You can specify an upper bound for a wildcard, or you can specify a lower bound, but you cannot specify both.

提交回复
热议问题