LinkedList<Object[]>[] declaration LinkedList<Object[]>[] means an array Array Lists - Is It Intent? Assuming this is the case, you create it with the syntax for creating arrays:
public LinkedList<Object[]>[] myArray = new LinkedList[ARRAY_SIZE];
Creates an array of the specified size ( ARRAY_SIZE ), each cell of which is null .
Note that:
- Since you cannot create shared arrays in Java, as Hunter Macmillen noted , the right-hand side did not specify a
LinkedList type (ie <Object[]> "). - I took the liberty of renaming the variable from
myList to myArray , since it is an array, not a list. - It is generally recommended that you use an interface (
List ) rather than a specific implementation ( LinkedList ) unless you need methods specific to LinkedList .
So the line will look like this:
public List<Object[]>[] myArray = new List[ARRAY_SIZE];
source share