Java Programming Tutorial 42 - Iterate through 2D Structure with for Loop

preview_player
Показать описание


~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

🅑 Bitcoin - 3HnF1SWTzo1dCU7RwFLhgk7SYiVfV37Pbq
🅔 Eth - 0x350139af84b60d075a3a0379716040b63f6D3853
Рекомендации по теме
Комментарии
Автор

Nice touch there with the refactoring tool. Bonus learning! Thanks

lodashnotebook
Автор

yea the refactoring rename tool is very useful thanks boss !

rittenbrake
Автор

how did we get 3 at 1:11? Is this because the total number of rows or the size of the array?

marco
Автор

In the second for loop at k < grades[i].length and in System.out.println(grades[i][k]), I keep getting an error for the two i's and the k inside the square brackets that says these cannot be resolved to a variable. Any help?

caseyott
Автор

When would you use a 2d array? Just want to know/see a quick example.

JesseQuickEats
Автор

For some reason I'm getting an error telling me that the data type should be a boolean in the for loops instead of an int.

import java.util.Arrays;

public class TwoDimensionalArrays {

public static void main(String[] args) {
int[][] studentGrades = {
{1, 5, 3},
{1, 4, 5, 6, 3, 5, 2},
{4, 6, 9}
};
//



for (int i = 0; studentGrades.length; i++) {
for (int k = 0; studentGrades[i].length; i++) {

}
}
}
}

davidcollinhannah
Автор

Do you offer one on one time? Consulting?

woodydameron
Автор

this code works just aswell as caleb's:


import java.util.Arrays;
import java.util.Scanner;

public class App{
public static void main(String[] args){

int[][] grades = {
{1, 2, 3, 73, 5},
{32, 3, 45, 435, 65, 7567, },
{456, 45, 64, 56}
};

for(int row =0; row<grades.length; row++){

}


}
}

Willsheep-yuzt