The essence of LinkedList is a doubly linked list. Implements the List interface and can queue operations on it. Implement the Deque interface to use LinkedList as a double-ended queue.
The LinkedList is non-synchronous.
The inheritance relationship of LinkedList
java.lang.Object ? Java.util.AbstractCollection<E> ? Java.util.AbstractList<E> ? Java.util.AbstractSequentialList<E> ? Java.util.LinkedList<E>publicclass linkedlist<e> extends abstractsequentiallist<e> implements List<e>, Deque<e>, Cloneable, java.io.Serializable {}
LinkedList constructor function
// default constructor LinkedList () // creates a linkedlist that protects all elements in the collection. extends e> collection)
LinkedList's API
BooleanAdd (E object)voidAddintLocation , E object)BooleanAddAll (collection<?extendsE>collection)BooleanAddAll (intLocation, collection<?extendsE>collection)voidAddFirst (E object)voidaddlast (E object)voidClear () Object clone ()Booleancontains (Object object) Iterator<E>descendingiterator () e element () e Get (intLocation ) e GetFirst () e getlast ()intindexOf (Object object)intlastIndexOf (Object object) Listiterator<E> Listiterator (intLocation )BooleanOffer (E o)BooleanOfferfirst (e e)BooleanOfferlast (e e) e peek () e Peekfirst () e peeklast () e poll () E Pollfirst () e polllast () e pop ()voidpush (e E) e remove () e Remove (intLocation )Booleanremove (Object object) E Removefirst ()Booleanremovefirstoccurrence (Object o) E removelast ()Booleanremovelastoccurrence (Object o) E set (intLocation , E object)intsize ()<T>t[] ToArray (t[] contents) object[] ToArray ()
Java Collection--linkedlist