What data structure does the following declaration specify?
List[] myArray;
I think it should declare an array where each
You are correct in saying:
After running some tests, I determined the declaration means an array where each element is an ArrayList object.
Executing this code
List[] myArray = new ArrayList[2];
myArray[0] = new ArrayList();
myArray[0].add("test 1");
myArray[1] = new ArrayList();
myArray[1].add("test 2");
print myArray;
Produces this result:
{["test 1"], ["test 2"]}
It seems to me there is no reason not to do this instead:
List myArray = new ArrayList();