AbstractSequentialList remove() method in Java with Examples Last Updated : 26 Nov, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report The remove(int index) method of AbstractSequentialList is used to remove an element from an abstract sequential list from a specific position or index. Syntax: AbstractSequentialList.remove(int index) Parameters: The parameter index is of integer data type and specifies the position of the element to be removed from the AbstractSequentialList. Return Value: This method returns the element that has just been removed from the list. Below programs illustrate the AbstractSequentialList.remove(int index) method: Program 1: Java // Java code to illustrate remove() method import java.util.*; import java.util.AbstractSequentialList; public class AbstractSequentialListDemo { public static void main(String args[]) { // Creating an empty AbstractSequentialList AbstractSequentialList<String> absqlist = new LinkedList<String>(); // Using add() method to add elements in the list absqlist.add("Geeks"); absqlist.add("for"); absqlist.add("Geeks"); absqlist.add("10"); absqlist.add("20"); // Output the list System.out.println("AbstractSequentialList: " + absqlist); // Remove the head using remove() absqlist.remove(3); // Print the final list System.out.println("Final List: " + absqlist); } } Output: AbstractSequentialList: [Geeks, for, Geeks, 10, 20] Final List: [Geeks, for, Geeks, 20] Program 2: Java // Java code to illustrate remove() // with position of element passed as parameter import java.util.*; import java.util.AbstractSequentialList; public class AbstractSequentialListDemo { public static void main(String args[]) { // Creating an empty AbstractSequentialList AbstractSequentialList<String> absqlist = new LinkedList<String>(); // Use add() method to add elements in the list absqlist.add("Geeks"); absqlist.add("for"); absqlist.add("Geeks"); absqlist.add("10"); absqlist.add("20"); // Output the list System.out.println("AbstractSequentialList:" + absqlist); // Remove the head using remove() absqlist.remove(0); // Print the final list System.out.println("Final AbstractSequentialList:" + absqlist); } } Output: AbstractSequentialList:[Geeks, for, Geeks, 10, 20] Final AbstractSequentialList:[for, Geeks, 10, 20] Comment More infoAdvertise with us Next Article AbstractSequentialList remove() method in Java with Examples C chinmoy lenka Follow Improve Article Tags : Misc Java Java-Collections Java - util package Java-Functions java-AbstractSequentialList +2 More Practice Tags : JavaJava-CollectionsMisc Similar Reads AbstractSequentialList in Java with Examples The AbstractSequentialList class in Java is a part of the Java Collection Framework and implements the Collection interface and the AbstractCollection class. This class provides a skeletal implementation of the List interface to minimize the effort required to implement this interface backed by a "s 7 min read AbstractSequentialList size() method in Java with Example The size() method of AbstractSequentialList in Java is used to get the size for this instance of the AbstractSequentialList. It returns an integer value which is the size for this instance of the AbstractSequentialList. Syntax: public int size() Parameters: This method does not accepts any parameter 2 min read AbstractSequentialList conatinsAll() method in Java with Example The containsAll() method of Java AbstractSequentialList is used to check whether two Collections contain the same elements or not. It takes one collection as a parameter and returns True if all of the elements of this collection is present in the other collection. Syntax: public boolean containsAll( 2 min read AbstractSequentialList lastIndexOf() method in Java with Example The lastIndexOf() method of java.util.AbstractSequentialList class is used to return the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i) 2 min read AbstractSequentialList hashCode() method in Java with Example The hashCode() method of AbstractSequentialList in Java is used to get the hashCode value for this instance of the AbstractSequentialList. It returns an integer value which is the hashCode value for this instance of the AbstractSequentialList. Syntax: public int hashCode() Parameters: This function 2 min read AbstractSequentialList retainAll() method in Java with Example The retainAll() method of java.util.AbstractSequentialList class is used to retain from this list all of its elements that are contained in the specified collection. Syntax: public boolean retainAll(Collection c) Parameters: This method takes collection c as a parameter containing elements to be ret 3 min read AbstractSequentialList subList() method in Java with Example The subList() method of AbstractSequentialList in Java is used to get a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so non-structural c 2 min read AbstractSequentialList toArray() method in Java with Example The toArray() method of Java AbstractSequentialList is used to form an array of the same elements as that of the AbstractSequentialList. Basically, it copies all the element from a AbstractSequentialList to a new array. Syntax: Object[] arr = AbstractSequentialList.toArray() Parameters: The method d 2 min read AbstractSequentialList toArray(T[]) method in Java with Example The toArray(arr[]) method of AbstractSequentialList class in Java is used to form an array of the same elements as that of the AbstractSequentialList. It returns an array containing all of the elements in this AbstractSequentialList in the correct order; the run-time type of the returned array is th 4 min read AbstractSequentialList contains() method in Java with Example The contains() method of Java AbstractSequentialList is used to check whether an element is present in a Collection or not. It takes the element as a parameter and returns True if the element is present in the collection. Syntax: public boolean contains(Object element) Parameters: The parameter elem 2 min read Like