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.
Syntax:
AbstractList.remove(int index)
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:
Program 1:
Output:
AbstractList: [Geeks, for, Geeks, 10, 20]
Final AbstractList: [Geeks, for, Geeks, 20]
Program 2: