Hey, I have a 2d array, currently with 10 rows, and 3 columns, but will soon be expanding. I need to count how many 0's are in each column, and store them as a separate integer. I have tried really hard on this, and I can just not figure it out! Now I know I will need something like: for (int col = 0; col < Data.score[0].length; col ++) { for (int row = 0; row < Data.score.length; row ++) { // Count 0's from each row, and save into separate int's } } Code (markup): As you can tell, I am still quite new to java... Any help would be extremely appreciated!
Example for C++, not JAVA. Hope you'll get a liitle help. a[j]; //2D array arr[j]; for (int col = 0; col < j; col ++) { for (int row = 0; row < i; row ++) { if(a[j] == '0') arr[j]= count++; } }