0
public class Program { public static void main(String[] args) { int[ ][ ] sample = { {1, 2, 3}, {4, 5, 6} };
The output of this program is 4,how?
5 odpowiedzi
+ 2
Share your post next time or put the code in description and not in title.
https://www.sololearn.com/post/467576/?ref=app
1 2 3
4 5 6
4 is at 1st row and 0th column.
+ 2
Saurav Menon That is two dimensional array and here on 0 index array is {1, 2, 3} and on 1st index array is {4, 5, 6}
So according to your problem on sample [1] [0]
1st index array has 3 values and 4 is on 0th index so
sample [1][0] = 4
0
Huh, I am not a java expert but this code doesn't look valid first of all and then there is no print statement, how can you even get output?
0
Oops sorry for that, silly me
0
Double dimensional array,
a[row][column]=a[1][0]-->4(output).