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) Adding element to the end of the List
boolean add(Object element)
Adds specified element to the end of the ArrayList
2) Insert element in the middle of the ArrayList
void add(int index, Object element)
Inserts specified element into the ArrayList at given index. This method can throw IndexOutOfBoundsException if index is out of range.
3) Append elements of a Collection to ArrayList
boolean addAll(Collection c)
Appends all elements of specified Collection in order returned by the specified Collection’s Iterator.
4) Insert elements of a Collection to ArrayList
boolean addAll(int index, Collection c)
Inserts all elements of the specified collection into ArrayList at given index. This method can throw IndexOutOfBoundsException if index is out of range.
<< Java ArrayList Constructors Search Elements from Java ArrayList >>

addAll() can also be used to
Post new comment