Campbell Ritchie wrote:In that case, I was mistaken and 9 does appear to be correct. I would have thought that outer array would be filled with nulls; I was obviously mistaken. Sorry.
It would be with the syntax
int[][][] numbers =
new int[2][][], but the given syntax allows you to fully populate multi-dimensional arrays*, so only the lowest level is filled with the default values (zero, in this case).
(* Yes, that was just to wind you up! To be fair, initialising them like this is the one time it almost makes sense to refer to them as multi-dimensional arrays rather than arrays-of-arrays-of-arrays-of...)