0

What is the use of this ( myarr[0][2] = 42; ) in this code without that too the compiler give same output...???

public class Program { public static void main(String[] args) { int[ ][ ] myArr = { {1, 2, 3}, {4}, {5, 6, 7} }; myArr[0][2] = 42; int x = myArr[1][0]; System.out.println(x); } }

19th May 2017, 10:24 AM
yamil mohamed p
yamil mohamed p - avatar
3 Réponses
+ 1
it set the 42 value at 0 row 2 Column in this code it has no use . just to confuse you.
19th May 2017, 10:41 AM
MR Programmer
MR Programmer - avatar
0
oh..
20th May 2017, 11:00 AM
yamil mohamed p
yamil mohamed p - avatar
0
Yeah this has me confused too.. I understand everything else but not what this is for myArr[0][2] = 42;
12th Jun 2017, 11:51 PM
David