请教linkedlist源代码,有点没明白什么意思。
public int indexOf(Object o) {
int index = 0;
if (o==null) {
for (Entry e = header.next; e != header; e = e.next) {
if (e.element==null)
return index;
index++;
}
} else {
for (Entry e = header.next; e != header; e = e.next) {
if (o.equals(e.element))
return index;
index++;
}
}
return -1;
}
if (o==null) {
for (Entry e = header.next; e != header; e = e.next) {
if (e.element==null)
return index;
index++;
}
}
这一部分什么意思?o==null?
...全文
相关推荐
Java 中Linkedlist类的源代码
Java 中Linkedlist类的源代码Java 中Linkedlist类的源代码Java 中Linkedlist类的源代码Java 中Linkedlist类的源代码
Java中ArrayList和LinkedList区别
一般大家都知道ArrayList和LinkedList的大致区别: 1.ArrayList是实现了基于动态数组的数据结构,LinkedList基于链表的数据结构。 2.对于随机访问get和set,ArrayList觉得优于LinkedList,因为LinkedList要移动指针。 3.对于新增和删除操作add和remove,LinedList比较占优势,因为ArrayList要移动数据。 ArrayList和LinkedList是两个集合类,用于存储一系列的对象引用(references)。例如我们可以用ArrayList来存储一系列的String或者Integer。那
java LinkedList的添加删除操作
java LinkedList的添加删除操作 java LinkedList的添加删除操作
java中LinkedList任意排序实例
使用LinkedList类编写程序,用某种集合接口的实现类作存储,实现具有自定义排序功能的包含姓名、年龄、身高、职称等内容的人事信息输入和打印。
对ArrayList和LinkedList底层实现原理详解
今天小编就为大家分享一篇对ArrayList和LinkedList底层实现原理详解,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧


Java SE
