Files
Hui-s-notebook/logseq-java/pages/泛型.md
2024-02-02 00:12:49 +08:00

12 lines
362 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
- 含有不同类型数据时,集合在 [[向下转型]] 时报错
- 用来规范集合中元素类型的一种技术
- 格式
- <数据类型>
- [[泛型类]]
- [[泛型方法]]
- [[泛型接口]]
- [[泛型擦除]]
- 代码在编译期间有编译器自动将Student替换原有的E
- ```java
List<Student> student = new ArrayList<Student>();
```