addAll method in java Collections

The addAll method adds specified collection of elements to a specific collection ( like List , Set , Collection , Vector ) .


addAll method  Add elements to a Collection interface , and pass it to addAll method as an argument .

addAll method  For ordered collection (Ex : List ,Vector)  ,  addAll method inserts the new collection of elements at

……..the end position.

addAll method  For unordered collection (Ex: Set , HashSet) , it adds the new collection of elements in an

……..unordered manner .



 <collection object name>.addAll(<newCollection object name>)

Example for addAll method :

Execution Result:

 addAll method  returns true , if the Collection of elements added successfully .
  The behavior of this operation is undefined , if the specified collection is modified while the

……..operation is in progress.

Related Posts :
PL/SQL Arrays and nested tables ( Collections )
removeAll method in Collections framework
containsAll method in Collections framework
toArray method in Collections framework
retainAll method in Collections framework
   [will not be published]

^ <