Java Sudoku:通用阵列创建

时间:2012-05-21 01:53:21

标签: java arrays generics creation sudoku

  

可能重复:
  Java how to: Generic Array creation
  Generic array creation error

private ArrayList<Integer>[][] potentialList = new ArrayList<Integer>[9][9];

有人,请向我解释为什么这句话给了我一个:

--------------------Configuration: <Default>--------------------  
SolveSudoku.java:31: error: generic array creation  
private ArrayList<Integer>[][] potentialList = new ArrayList<Integer>[9][9];  
//The error is on the "n" of new ArrayList.

Process completed.

1 个答案:

答案 0 :(得分:0)

我们不知道你想做什么,也许:

private ArrayList<Integer[][]> potentialList = new ArrayList<Integer[][]> (); 

这将是2dim-Integer-Arrays的列表。