Reputation: 742
I have a two dimensional array myArray[a][b] what is the most elegant way of referencing the single dimension array myArray[a][2] in Java.
Upvotes: 1
Views: 112
Reputation: 136062
If I understood question correctly, this is it
int a[][] = {{1,1,1},{2,2,2}, {3,3,3}};
int[] a2 = a[2];
,
Upvotes: 1