+ 2
What is meant by multidimensional array..
6 Respostas
+ 3
Array in array.
+ 3
/*Its basicly array of strings or intergers
the boxes [] []are there to tell the system which array to use/print for example..*/
String [][]x = {{"Hello ","Hey "},{"World!!","Planet!!}};
System.out.println(x[0][0] + x [1][0] );
/*output Hello World!!
Remeber that java counts from 0 to 1 when working with things like this.
x [0][0] = [0] 1st array list [0] 1st array word
x [1][0] = [1] 2 array list [0] 1st array word
kind of confusing if your new but aslong as you see that 0 is basicly 1 in the way we count then it makes sense why java does this*/
+ 1
multidimensional usually refers for just 2 lengths. If you have a table 3 by 3, it's useful if you can identify one spot by x,y coordinates. So a multidimensional array is just way of saying that you have a table, or a map with longitude and latitude, but it works only on indexes and it starts with 0.
example : String myLatitude = myarray [0,0] is the first element in a table
0
A classic array is like this :
myArr[3]={1,2,3}
A multidimentionnal array is :
myMultiArray[2][2]={{1,2}{5,9}}
myMultiArray [1][0] == 5
Ask if you want more informations
0
you put a box inside a box.
0
Instead of a 2x2 matrix that is easily represented on a flat screen, imagine a die with more sides...