java2db

removeAll method in Collections framework



The removeAll method  uses to remove one or more elements form a collection (Set , List , Vector).If there is no matches in the collection , it returns false .

 

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

removeAll method It returns true , if the elements removed  successfully from the collection .

 

Syntax:

 <collection object name>.removeAll(<collection object name>)

Example for removeAll method :

Execution Result:

 

removeAll method Throws ClassCastException , if the class of an element  is incompatible with the specified collection.

removeAll method Throws NullPointerException, if the set contains a null element and the specified collection does not

……..permit null elements.

 




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



^ <