Whats the use of saying <? extends SomeObject> instead of

后端 未结 5 1772
陌清茗
陌清茗 2020-11-27 18:54

So I was looking over some Java code and stumbled upon:

List l;

basically this list accepts all objects that ar

5条回答
  •  执笔经年
    2020-11-27 19:43

    As the first answer,

    List l;
    

    must contains Object that inherit from SomeObject, not some direct SomeObject.

提交回复
热议问题