Many of the generic collection types are direct analogs of nongeneric types.
许多泛型集合类型是非泛型类型的直接模拟。
Listing 5-8 demonstrates how to construct and initialize an array and two classes from the generic collection library.
清单5 - 8演示了如何构造并初始化一个数组和两个一般集合库中的类。
Listing 2 contains a program that generates the compilation-time error message that happens when you try to add the wrong type of element to a generic collection - a List in this case.
在尝试向泛型集合(本例中为List)添加错误类型的元素时,清单2中的程序会生成编译时错误消息。
应用推荐