VOOZH about

URL: https://www.geeksforgeeks.org/java/abstractcollection-remove-method-in-java-with-examples/

⇱ AbstractCollection remove() Method in Java with Examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

AbstractCollection remove() Method in Java with Examples

Last Updated : 11 Jul, 2025
The remove(Object O) method of Java AbstractCollection is to remove a particular element from a Collection. Syntax:
AbstractCollection.remove(Object O)
Parameters: The parameter O is of the type of Collection and specifies the element to be removed from the collection. Return Value: This method returns True if the element specified in the parameter is initially present in the collection and is successfully removed otherwise it returns False. Below program illustrate the Java.util.AbstractCollection.remove() method: Program 1:
Output:
Collection: [4, Geeks, To, TreeSet, Welcome]
New Collection: [To, Welcome]
Program 2:
Output:
Collection: [Welcome, To, Geeks, 4, Geeks, LinkedList]
New Collection: [Welcome, To, Geeks]
Comment