title: Array of ArrayList Java
body: <p>I am creating an PriorityQueue with multiple queues.  I am using an Array to store the multiple ArrayLists that make up my different PriorityQueues.  Here is what I have for my constructor so far: </p>
  
  <pre><code>ArrayList&lt;ProcessRecord&gt; pq;
  ArrayList[] arrayQ;
  
    MultiList(){       
     arrayQ = new ArrayList[9];
     pq = new ArrayList&lt;ProcessRecord&gt;();
   }
  </code></pre>
  
  <p>The problem comes when I am trying to get the size of the entire array, that is the sum of the sizes of each <code>ArrayList</code> in the array. </p>
  
  <pre><code>public int getSize() {
  
      int size = 0;
  
      for (int i = 1; i &lt;= 9; i++) {
          size = size + this.arrayQ[i].size();
      }
      return size;
  }
  </code></pre>
  
  <p>is not seeming to work.  Am I declaring the Array of <code>ArrayList</code> correctly?  I keep getting an error saying that <code>this.arrayQ[i].size()</code> is not a method.  (the .size() being the problem)</p>
  
  <p>Thanks for any help! </p>
  
  <p>David</p>