I have a 3D array, I am able to find all the index of all the array elements except one element "null"
i.e. the one after the element "x"
.
public class StringArrayTest
{
public static void main(String args[])
{
String[][][] arr ={
{
{ "a", "b" , "c"},
{ "d", "e", null }
},
{
{"x"}, null },
{{"y"}
},
{
{ "z","p"},
{}
}
};
System.out.println(arr[0][1][2]);
}
}
The question was taken from a book and the question itself was not indentated properly and it is quite confusing in the 2nd part of the array(the place where element x is).
I was able to find the index of the following element :-
a:-[0][0][0]
b:-[0][0][1]
c:-[0][0][2]
d:-[0][1][0]
e:-[0][1][1]
null:-[0][1][2]
x:-[1][0][0]
null:-Not able to find
Y:-[2][0][0]
z:-[3][0][0]
p:-[3][0][1]
What is the index value of the 2nd null, and please explain your answer.