 Multidimensional arr | Sololearn: Learn to code for FREE!

+5

# Multidimensional arr

i confused when i learn multidimensional of array. now see this. int [][] sample = {{2,3,4}},{{789}}; int x = sample  ; system.out.println (x); i dont understand the code above. please help me guys

+11

THE SIMPLE WAY TO STUDY THE MULTIDIMESTIONAL ARRAY LETS UNDERSTAND THE POSITIONS OF ROW & COLUMN LETS TAKE A EXAMPLE ARR THE POSITIONS ARE ROW & COLUMN 0,0 0,1 0,2 1,0 1,1 1,2 2,0 2,1 2,2 IF WE HAVE ARR{{1,2,3},{4,5,6},{7,8,9}} WE CAN WRITE AS 1 2 3 4 5 6 7 8 9 WHERE ARR=1 , ARR= 2, ARR=3, ARR=4, ARR=5, , ARR=6, ARR=7, ARR=8, ARR=9 IN 1,2 THE FIRST ONE IS D POSITION OF ROW & SECOND ONE IS POSITION OF D COLUMN IT WOKS IN COORDINATE X,Y,Z IN ARRAY THE NO OF ROWS & COLUMN R (LENGTH-1) HOPE THIS WILL HELP YOU TO UNDERSTAND BRO THANKS

+4

thanks very very much sir i appreciate your answer. and now i understand how to describe the multidimensional arr

+3

It should be {{1,2,3},{789}}. To make it simple it's an array of {a, b}, where a is another array {1,2,3} and b is a single element array {789}.

+2

it's good example for understanding multidimensional array