Java Multidimensional Arrays -


i in process of learning java , confused on multidimensional arrays. when don't mean array syntax more logic of using arrays statements. wondering how incorporate arrays statements correctly , of code in play do, , why there. here code have been working on (based off tutorial) , wondering if explain going on.

package tutorial;  public class apples { public static void taco(string[] args) {     int firstarray[][]={{8,9,10,11},{12,13,14,15}};     int secondarray[][]={{30,31,32,33},{43},{4,5,6}};      system.out.println("this first array");     display(firstarray);      system.out.println("this second array");     display(secondarray); }  public static void display(int x[][]) {     (int row=0;row<x.length;row++) {         (int column=0;column<x[row].length;column++) {             system.out.println(x[row][column]+"\t");         }         system.out.println();     } } 

so don't understand entire

public static void display(int x[][]) {     (int row=0;row<x.length;row++) {         (int column=0;column<x[row].length;column++) {             system.out.println(x[row][column]+"\t"); 

if explain in more depth great. statements , arrays in general, im confused how works.

you can @ 2 dimensional array int x[][] array elements arrays of int.

therefore, x has x.length int array elements, , each of them int array of x[row].length ints.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -