I have a 2d array named multi and its declaration is
Object[][] multi = new Object[10][10];
I tried to add some elements like that x and y are Integers
multi[y][x]=10;
not when i print anything from this array or the hole array i got nulloutput the whay i print
System.out.println(multi[0][0]);
or
for(int r = 0; r < 10; r++) {
for(int g = 0; g <10; g++) {
System.out.println(multi[r][g]);
}
}
nullprints, and one print with10, if you only assign one value. Could you include the whole code, or rather the method that is executed this specific code.multi[r](for0 <= r < 10) are initiallynull; they would only not be if you assign them a non-null value subsequently.multi[0][0]=10;and print oly one element like thatSystem.out.println(multi[0][0]);i got anullprint