這是代碼sinplet:的ArrayList到陣列converstion - 指定者()函數推斷出的類型不符合上限錯誤
Excel excel = new Excel();
ArrayList<Integer> a1=excel.readExcelSheet("C:\\Users\\Madhukar\\Desktop\\Employee.xls");
System.out.println("Using Iterator");
Iterator iterator = a1.iterator();
while (iterator.hasNext()) {
System.out.println(iterator.next());}
int x=a1.size();
int[] a3=new int[x];
a3=a1.toArray(a3);
這是錯誤消息:
沒有合適的方法發現對於toArray(int []) 方法AbstractCollection.toArray(T#1 [])不適用 (推斷的類型不符合上限 推斷:int 上限:對象)
where T#1,T#2 are type-variable...