Edit: Maybe it's a 3d array? I don't want to use ArrayList.
I know this is basic but I'm still having trouble wrapping my head around arrays. So I want to create a 2d array with 7 rows and 4 columns, like this:
0 1 2 3
0
1
2
3
4
5
6
And in each spot I want to put two numbers. For example,
0 1 2 3
0 (1, 8) (2, 7) (3, 6) (4, 5)
1
2
3
4
5
6
Just as an example, if I was trying to fill (2,5) in it all in via for loops, I would do:
int[][][2] table = new int[7][4][2];
for (int i = 0; i < 7; i++) {
for (int j = 0; i < 4; j++) {
table[i][j][1] = 2;
table[i][j][2] = 5;
}
}
This isn't right. I can't figure out how to do it. Also, how would I reference a specific cell when it is correct? Like in the first example, if I wanted (1,8), would I put: table[1][1]? Or if I wanted just the 1 would I put: table[1][1][1]?
Pair<Integer, Integer>).Pair<Integer, Integer>[][].Pointclass be a simpler solution?