just to confirm that when arrays are declared and instantiated, the length of array in terms of rows and columns cannot change.
right ? they are fixed after they have been declared. Though one can manipulate member values but one cannot add new members.
That's right. Once you've declared an array, you can not change its length. You can, however, leave parts of a multi-dimensional array as null and then fill them in when you know the proper length. This isn't really adding new elements to the array, but it does offer some control over the size of the array.
For example, say you're going to read a number of files and store the contents into an array. We'll assume that we can look into one file to get the number of files and names of the files that we'd like to read in. Since it doesn't relate to this question, we'll assume that the file contains a message saying that we'll need to read in 3 files, "foo.txt," "bar.txt," and "baz.txt." Now, to create a properly sized array, you might do something like this:
Using techniques like this, you can better control the size of your array but, you're right, once an array's length has been set, it can not be changed.
Corey