Java source reading (constantly added)

Source: Internet
Author: User

Java.util.LinkedList
LinkedList is a doubly-linked list implementation that implements the list interface, owns all of the list's methods, and allows all elements (including null).
A doubly linked list is also called a doubly linked list, which is a list of two pointers in each data node, pointing directly to successive and direct precursors respectively. So, starting from any node in a doubly linked list, it is easy to access its predecessor and successor nodes. In general, we construct two-way circular linked lists.
It is important to note that LinkedList is non-synchronous when a large number of threads concurrently access the linked list, when at least one thread modifies the structure of the listing, it must be externally synchronized (structural modification refers to the
Adding or removing actions for one or more elements, setting the value simply cannot be a modification of the list structure. Synchronization is typically achieved by encapsulating some objects in the list.
If no such object exists, the list should be synchronized using the Collections.synchronizedlist method. This is best used when creating a list, for
Prevent accidental non-synchronous access to this list:
List List = Collections.synchronizedlist (new LinkedList (...));
Returning iterators by calling the iterator and Listiterator methods will immediately give an error when the following occurs: modify their structure at any time after the iterator is created
The iterator throws a concurrentmodificationexception in any way except through the iterator's own remove or add. Therefore, if the synchronization operation is not performed,
In the face of concurrency, iterators can fail quickly and completely.
public class Linkedlist<e> extends abstractsequentiallist<e>
Implements List<e>, Deque<e>, Cloneable, java.io.Serializable
{
Likedlist is a class that implements the list interface and is capable of serializing operations (implementing the Java.io.Serializable interface).

Java source reading (constantly added)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.