What does it mean for a non generic class to extend a generic class

后端 未结 6 2063
广开言路
广开言路 2021-02-04 10:23
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-04 10:44

    In simple words

    That doesn't mean anything, unless there are some methods defined in Class C or its ascendants, to either accept or return Type A parameters.

    By doing so you are ensuring the Type safety by imposing restrictions saying "They can accept or return objects of Type A".

提交回复
热议问题