ArrayList数组、LinkedList如何在最前面加一个元素?
list.add(0, object);
使用了List.add(int index, E element)方法,当第一个参数为0的时候,代表往List最前面增加一个元素。
ArrayList数组、LinkedList如何在最前面加一个元素?
list.add(0, object);
使用了List.add(int index, E element)方法,当第一个参数为0的时候,代表往List最前面增加一个元素。
list基本操作
Java list顺序打乱
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M