Java has no limits, but it can make a tremendous difference if you think about what the code is doing.
The point is that java is a language and not a compiler. The result of the code above is that the array of integers will be declared as a two dimensional array. But a two dimensional array is nothing more than a single dimension. It’s just a way to declare the array to be that dimension. So if you declare a one dimensional array, you’re telling the compiler that you want a single dimension array and then you go ahead and declare it.
Java is a language, not a compiler. The array will declare itself as a two dimensional array because the language allows two dimensional arrays. If you want a single dimension array, you can declare it as an array of whatever type. Java doesn’t limit you to a certain number of dimensions, or to a minimum number. You can declare arrays of any size you like, and you can declare them as either one, two, or three dimensional.
Array types also include List, Set, and Maps.
The Java compiler can tell you that ArrayList is a two dimensional array. But it cannot tell you that ArrayList is a list of lists. That’s because ArrayList is a two dimensional array, not a list of lists. All Java does is give you a hint.
Java’s ArrayList is a two dimensional array which is then converted to a list of lists. The Java compiler can tell you that an ArrayList is a list of lists (of lists). You can also declare an array of any size you like, but you cannot declare an array of size 0. This is because it’s a two dimensional array, not a list of lists.
The last time I tried to work with arrays, I was a bit lost. But the only other time I tried to work with arrays is when I was doing a project for my class and tried to make me a giant array containing all the numbers from 0 to 1,000,000. But I couldn’t figure out how to do this.
The point is that you cannot declare an array of size 0. So if you want an array of size 0, you must declare it as an array of length 0. This makes sense if you think about it. If you have an array of size 2, you have to declare it as an array of length 2. But if you don’t declare it as a list of lists, then it’s just an array of length 1.
Java does not limit the array to have a certain number of dimensions. It allows you to declare any size and it will use all of them. It’s a simple concept.