Java: Variable size array of int
<p>Hey guys I'm trying out arraylists and I need to make a variable sized array of integers.
I don't know if I'm implementing it right.
How do I go about doing this? Can someone help me out with the syntax?</p>

<pre><code>    Integer[] ints = new Integer[x];
    static List&lt;Integer&gt; ints = new ArrayList&lt;Integer&gt;();
</code></pre>

<p>I want to be able to do things like ints.add(0);
etc.</p>

<p>EDIT: Code:</p>

<pre><code>  Integer[] ints = new Integer[x]; 
  static List&lt;Integer&gt; ints = new ArrayList&lt;Integer&gt;(); 
  ints.clear(); 
  for (int counter2 = 0; counter2 &lt; 50; counter2++) { 
      if (list[counter2].userActive == true) { 
        if (list[counter2].getLastName().equals(lastName) || (lastName=="")) { 
           if ((list[counter2].getFirstName().equals(firstName))||(firstName=="")
                &amp;&amp; (list[counter2].userActive == true)) 
                ints.add(counter2);    
</code></pre>
