Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
1) ArrayList()
Creates an empty ArrayList.
Example
ArrayList arrayList = new ArrayList();
2) ArrayList(int capacity)
Creates an ArrayList with specified initial capacity.
Example
ArrayList arrayList = new ArrayList(10);
3) ArrayList(Collection c)
Creates an ArrayList containing elements of the collection specified.
Example
ArrayList arrayList = new ArrayList(myCollection);
Where myCollection is an object of the type Collection.
Creates ArrayList of elements containing in the myCollection, in order returned by the myCollection’s Iterator.
<< Java ArrayList Adding Elements to Java ArrayList >>

Post new comment