java - Access multi-dimentional Array -
array :
public static string[][] dhaka_header = { {"a", "a", "a", "a", "a", "a", "a"}, {"b", "b", "b", "b", "b"}, {"c", "c", "c"}, };
how can access each array element?
you have 2-dimensional array: array[rows][cols]
.
you can access each member of array nested for
so:
for (int row = 0; row < array.length; row++) { (int col = 0; col < array[row].length; col++) { array[row][col] = "0"; // whatever want goes here } }
Comments
Post a Comment