java.util.LinkedList<E> public boolean offerLast(E e)
Inserts the specified element at the end of this list.
在此列表末尾插入指定的元素。
LinkedList<Integer> list = new LinkedList<>();
list.offerLast(19);
一种错误写法:
启用了类型检查的编译器直接禁止创建泛型数组。因为 Java 的泛型是基于擦除实现的
只能这样写,不带泛型: