Initializing an ArrayList in main method
<p>I'm trying to test a quick small program :</p>

<pre><code>String p = ""; 

ArrayList&lt;Integer&gt; h = new ArrayList&lt;Integer&gt;( 25 ); 
h.add( 5 ); 
h.add( 9 ); 
h.add( 12 ); 

for ( int y : h ) 
  p = p + y; 
</code></pre>

<p>When I add it into my mainclass like this:</p>

<pre><code>public class Main
{
  public Main()
  {
    }


  public static void main( String[] args )
  {
     String p = ""; 
     ArrayList&lt;Integer&gt; h = new ArrayList&lt;Integer&gt;( 25 );
     h.add( 5 ); 
     h.add( 9 ); 
     h.add( 12 ); 

     for ( int y : h ) 
     p = p + y; 

     System.out.println(p);
    }
}
</code></pre>

<p>I get an error saying "Cannot find symbol - class ArrayList"</p>

<p>Why exactly am I getting this error? Do I have to make a new class for ArrayList or something? What do I have to do to make it work?</p>

<p>Thanks,</p>

<p>Rohan</p>
