Link to home
Start Free TrialLog in
Avatar of eternity5219
eternity5219

asked on

add integer to array list (URGENT)

HI experts,
 I want to create a 2d array of time array list, called Darray
ArrayList [][] DArray= new ArrayList [9][9];
and then give it values
DArray[i][j].add((int)board[i][j]);
which the value is integer value of a 2d array
but it gives me compilation error
any idea how to fix it?
SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of eternity5219
eternity5219

ASKER

ArrayList<Integer> [][] DArray= new ArrayList<Integer> [9][9];
 this one gives error (I use eclipse)

error is : (cannot create a generic array of  arraylist)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes I want a 9by 9 matrix of arrayList
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
81 ArrayLists each acting as a one-dimensional array
I need to solve Sudoku with arc consistenct method, so what I really need to do is to check each cell and save all of the possible numbers for that position in one array, there could be only one number or several number, but the problem is, I have my initial sudoku board as a 2 D array, and there are some filled cells on it, which I need to move those numbers into my 3d array ,(or I was thinking about 2d Arraylist),
and I cant do this becuz I cant assign and int value to arraylist,
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial