Just a quick and (hopefully) easy question about the actual memory allocation of lines of code.
in the code:
a = new Object;
is memory allocated for the array at the line Object a; or rather at the initialization inside the constructor?
What you have to remember is that a is not an array. It is a variable that can reference an array. So the first line allocates memory for the variable. The other line allocates memory for the array object.