First statement: int[] it = new int[][]{{1}}[0]; //Valid Statement
Second statement: int[][]it2 = new int[]{0}[0][0]; //Invalid Statement
First one no explanation given.
Second one is invalid because it attempts to access a two-dimensional object from a single dimension array.
My query:
1. First of all can someone please interpret those two lines in simpler terms :(
2. What is the difference between the two statements that makes second invalid.
3. Finally why in first statement there are two curly braces, how is that interpreted, as in what it symbolizes?
Terribly confused. Please help. Thanks in advance.
P.S. This is from Devaka Cooray Exam Lab for SCJP Certification.