<分区>
A 类是泛型类型,在 B 类中我想创建一个类型为 A 的对象数组,其中 Integer 作为泛型参数。
class A<T>
{}
class B
{
A<Integer>[] arr=new A[4]; //statement-1
B()
{
for(int i=0;i<arr.length;i++)
arr[i]=new A<Integer>();
}
}
但在 statement-1 中,我收到了未经检查的转换警告。创建此数组的正确方法是什么,因此我不需要使用任何抑制警告语句。