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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -