• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

java: array within an array?

Desova

Limp Gawd
Joined
Jun 24, 2002
Messages
467
i'm trying to store a 3x3 grid using a nested array:
Code:
  | 0 | 1 | 2
-------------  
0 | x | x | x
-------------
1 | x | x | x
-------------
2 | x | x | x
i tried doing
Code:
int square [3][3];
but having no joy, seems i'm doing a 2d array which works nothing like i had intended.

any ideas on how i'd have an array within an array, effectivey. so that i can access any co-ordinates from within a loop? (i.e. x = square[2][1];)
 
sorted. in case anyones interested the way to do it is:

Code:
int square[][] = new int[3][3]
 
Back
Top