Can someone make a table (graphic presentation or explanation) for this multidimensional array... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can someone make a table (graphic presentation or explanation) for this multidimensional array...

https://code.sololearn.com/cazR4UvBbgk6/?ref=app

31st Mar 2022, 11:14 AM
Eyy
2 Answers
+ 1
In the comments below are examples. https://www.sololearn.com/learn/Java/2149/?ref=app First we have rows and then columns. The array looks like this: 1 2 3 4 5 6 7 If we want 6. We go to row 2(index started with 0) and then column 1. so we write int x = myArr[2][1];
31st Mar 2022, 11:25 AM
Stefanoo
Stefanoo - avatar
+ 1
int[ ][ ] myArr = { { {1, 2, 3}, {4}, {5, 6, 7} }; myArr[0]=> {1, 2, 3}, myArr[1]=> {4}, myArr[2] => {5, 6, 7} ; myArr[0][0] = 1; myArr[0][1] = 2; myArr[0][2] = 3; similar way for remaining... you reassigning here myArr[0][2] = 42; int x = myArr[1][0]; //{4}'s value at index 0 System.out.println(x);
31st Mar 2022, 11:28 AM
Jayakrishna 🇮🇳