jdk版本:1.8 LinkedList添加元素有两个方法:add(E e)和add(int index,E e). add(E e) /** * Appends the specified element to the end of this list. * 在列表最后添加指定元素 */ public boolean add(E e) { linkLast(e); return true; } add(E e)是直接在队尾添加元素.再看一下linkLast(E e)方法,源码如下. void…