# data-structure **Repository Path**: yiyuxin/data-structure ## Basic Information - **Project Name**: data-structure - **Description**: 常用数据结构java实现 - **Primary Language**: Java - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-03-06 - **Last Updated**: 2024-01-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README JAVA泛型中的类型擦除及为什么不支持泛型数组? # 协变性 数组:协变性(covariant) 集合:非协变性 public interface Shape {} public class Circle implements Shape {} Circle[] IS-A Shape[] Collection IS-NOT-A Collection # 如何解决集合的非协变性 - 泛型 Collection arr # 集合的类型擦除和类型擦除带来的ClassCastException https://www.cnblogs.com/hapjin/p/5371950.html