0
Noob question regarding Multidimension Array
Hello! I would like to ask what is the use of myArr[0][2] = 42; in the code below (which is one of code example in Java's lesson)? 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); } } I have tried to remove myArr[0][2] = 42; and the output is still the same with or without, which made me curious what is the purpose?
7 odpowiedzi