What is different between array 1d and 2d | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

What is different between array 1d and 2d

5th Nov 2016, 5:52 AM
frhnims
2 Answers
+ 3
int[] arr = new int[5]; this is one dimensional array you have only rows. number of rows is 5. int[] array = new int[5][6] this is 2d array you have rows as well as columes. number of rows is 5. number of columes is 6.
5th Nov 2016, 6:13 AM
Aditya kumar pandey
Aditya kumar pandey - avatar
0
no different. it's the same for your memory allocation we can see a 2d array as an 1d ..
29th Dec 2016, 12:01 AM
dimitris kuriakopoulos
dimitris kuriakopoulos - avatar