![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java问题集
潭面无波
热爱学习,热爱代码,热爱生活!
展开
-
ArrayList和LinkedList的区别
1.ArrayList是实现了基于动态数组的数据结构,LinkedList基于链表的数据结构。 (LinkedList是双向链表,有next也有previous) 2.对于随机访问get和set,ArrayList觉得优于LinkedList,因为LinkedList要移动指针。 3.对于新增和删除操作add和remove,LinedList比较占优势,因为ArrayList要移动数据。 ...原创 2020-07-08 14:37:33 · 75 阅读 · 0 评论 -
Java中的fori和foreach效率比较
1. list的元素为自定义的对象 自定义的Student类 public class Student { private String name; private Integer age; public Student(String name, Integer age) { this.name = name; this.age = age; } public String getName() { retur转载 2020-07-08 14:34:28 · 3315 阅读 · 0 评论