Java Collection Learning (v) linkedlist Detailed introduction (source analysis) and usage examples

Source: Internet
Author: User

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)

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.