In front, we have learned the ArrayList and learned the fail-fast mechanism. In this chapter we then study the implementation class--linkedlist of list.
and learning ArrayList, the next, we have a general understanding of LinkedList, and then learn its source, and finally through the example to learn to use LinkedList.
The 1th part LinkedList introduction
LinkedList Introduction
LinkedList is a doubly linked list that inherits from the Abstractsequentiallist. It can also be manipulated as a stack, a queue, or a two-terminal queue.
LinkedList implements the List interface and can queue operations on it.
LinkedList implements the Deque interface, that is, LinkedList can be used as a two-terminal queue.
LinkedList implements the Cloneable interface, which covers the function clone () and can be cloned.
LinkedList implements the Java.io.Serializable interface, which means that LinkedList supports serialization and can be transmitted through serialization.
LinkedList is not synchronized.
The inheritance relationship of LinkedList
Java.lang.Object
java.util.abstractcollection<e>
java.util.abstractlist<e>
java.util.abstractsequentiallist<e>
java.util.linkedlist<e> Public
class linkedlist<e>
extends abstractsequentiallist<e>
implements List<e>, Deque<e>, Cloneable, java.io.Serializable {}
The relationship between LinkedList and collection is as follows:
LinkedList Constructors
Default constructor
LinkedList ()
Creates a linkedlist that protects all elements in the collection.
LinkedList (collection< extends e> Collection)