摘要: StringBuffer继承了AbstractStringBuilder,我们主要来看下AbstractStringBuilder这个类: AbstractStringBuilder 1)、成员 /** * The value is used for character storage. */ char value[]; /** * The count is the number of... 阅读全文
posted @ 2017-08-21 19:57 薏米仁儿 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 一、成员 private transient Entry header = new Entry(null, null, null); private transient int size = 0; 底层维护的是一个Entry链表(双向循环链表) 二、LinkedList.Entry类 成员 E element; //data Entry next; //前指针 Entry previo... 阅读全文
posted @ 2017-08-21 15:15 薏米仁儿 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 第一种:迭代器遍历 for(Iterator<String> it = list.iterator(); it.hasNext(); ) { .... } 这种方式在循环执行过程中会进行数据锁定,性能稍差,同时如果你想在循环过程中去掉某个元素,只能调用it.remove方法,不能使用list.rem 阅读全文
posted @ 2017-08-21 14:50 薏米仁儿 阅读(180) 评论(0) 推荐(0) 编辑