javac doesn't recognise API class

Joined
Feb 22, 2011
Messages
2
Reaction score
0
If I write a simple program like
public class testingthearraylist {
public static void main (String[] args) {
ArrayList testlist=new ArrayList ();
String a=new String ("a");
testlist.add(a);
System.out.println("Size of testlist is "+testlist.size());
}
}
javac (which I'm running from DOS) tells me the class 'ArrayList' is not recognised.

I always thought the library ships with Java. Is there a mistake in my program? Do I have to download the API?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top