0
有誰知道如何解決此警告?未經檢查的多維數組列表轉換
MyMain.java:12: warning: [unchecked] unchecked conversion
found : java.util.ArrayList[][]
required: java.util.ArrayList<java.lang.String>[][]
obj[count].someArrayList = new ArrayList[4][4];
我試圖將其更改爲:
obj[count].someArrayList = new ArrayList<String>[4][4];
但該修正案改變了警告到以下錯誤:
MyMain.java:12: generic array creation
obj[count].someArrayList = new ArrayList<String>[4][4];
someArrayList的聲明是:
public ArrayList<String>[][] someArrayList;
可能重複:// stackoverflow.com/questions/217065/cannot-create-an-array-of-linkedlists-in-java) – 2012-01-04 04:21:48