AbstractList remove() Method in Java with Examples
The remove(int index) method of java.util.AbstractList class is used to remove an element from an abstract list from a specific position or index.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
Parameters: The parameter index is of integer data type and specifies the position of the element to be removed from the AbstractList.
Return Value: This method returns the element that has just been removed from the list.
Below programs illustrate the AbstractList.remove(int index) method:
AbstractList: [Geeks, for, Geeks, 10, 20] Final AbstractList: [Geeks, for, Geeks, 20]
AbstractList:[Geeks, for, Geeks, 10, 20] Final AbstractList:[for, Geeks, 10, 20]