继承关系,在jdk11中的linkedList继承关系
public abstract class AbstractCollection implements Collection
public abstract class AbstractList extends AbstractCollection implements List
public abstract class AbstractSequentialList extends AbstractList
public class LinkedListextends AbstractSequentialList implements List, Deque, Cloneable, java.io.Serializable
linkedList实现了List接口,list接口里面包含了所有向外暴漏的方法。另外它还实现Deque队列、Cloneable、java.io.Serializable序列化的接口,如下
List list = new LinkedList();
LinkedList newList = new LinkedList();
newList.add("第一个");
newList.add("第二个");
newList.add("第三个");
newList.add("第四个");
newList.add("第二个");
newList.get(1);
newList.clone();//浅拷贝
Deque<?> d = new Linked