Well...
I'm afraid I'm just repeating everything but... I actually wanna figure out if I got it right!
First of all: Is an array an object??? Please answer, I'm new to
java...
Well...
Let us take a look back at declaration of 'years' and 'months':
float years[] [];
float months[];
So now months is a variable in which u can allocate any array of floats.
Now, let's jump to the code line in question:
months = years[1];
As I understand, if stuff produced in the right of the '=' operator is of the same kind of that the variable in the left of '=' is prepared to contain, then the assignment will, with no problems, be executed.
And that is our case! 'years' is a matrix, and 'years[1]' refers to an array of floats corresponding to the second vector or the 'years' matrix (the first vector is 'years[0]'). And months is prepared to contain such kind of stuff.
Notice, by the following line:
years = new float[3] [4];
that years is a matrix with THREE vectors of FOUR elements each. So, the array passed to 'months' is of 4 elements.
This explains how 'months[3]' doesn't generate any Array...Exception!
Well... think I'm done!
Ah! And please answer to my question! ('Is an array an object?)
And... please, forgive my english, for I'm native brazilian =)
Luck to y'all!