ArrayList数组、LinkedList如何在最前面加一个元素?

list.add(0, object);

使用了List.add(int index, E element)方法,当第一个参数为0的时候,代表往List最前面增加一个元素。