What data structure does the following declaration specify?
List[] myArray;
I think it should declare an array where each
List is a List capable of holding ArrayList objects List [] is an array of such Lists
So, what you said is that An Array of (List of ArrayList object) is CORRECT.
Can you share what your tests were. My own tests are different
import java.util.*;
public class TestList {
public static void main(String ... args) {
class MySpecialLinkedList extends LinkedList> {
MySpecialLinkedList() {
}
public void foo() {
}
public Object clone()
{
return super.clone();
}
}
List> [] someListArray = new MySpecialLinkedList[10];
for (int i = 0; i < 10; ++i) {
someListArray[i] = new LinkedList>();
for (int j = 0; j < 20; ++j) {
someListArray[i].add(new ArrayList());
for (int k = 0; k < 30; ++k) {
someListArray[i].get(j).add(j);
}
}
}
}
}