java 泛型不具备继承性
时间: 2023-09-27 17:08:09 浏览: 139
Java泛型不具备继承性的意思是,即使一个类型是另一个类型的子类,它们之间的泛型关系并不具备继承性。比如,如果我们定义一个List<Object>的变量,我们不能将其赋值为一个ArrayList<String>的实例,即使String是Object的子类。这样的赋值操作会导致编译错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Java学习13:泛型](https://blog.csdn.net/weixin_43741998/article/details/121223263)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Java泛型学习笔记 --> 通俗易懂,适合小白](https://blog.csdn.net/m0_54119587/article/details/127648773)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文