title: How to create an array of ArrayLists in java?
body: <p>I am creating an array but cannot add values to it.</p>
  
  <pre><code>ArrayList&lt;SMS&gt;[] lists = (ArrayList&lt;SMS&gt;[])new ArrayList[count];
  
          for(int i=0;i&lt;temp.size();i++)
          {
              String number="",id="";
              number = temp.get(i).addr;
              id = temp.get(i).thread_id;
              lists[i].add(temp.get(i));            // Problem here
          }
  </code></pre>
  
  <p>I am unable to add value to it</p>