![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JDK源码
文章平均质量分 50
天天看Code
这个作者很懒,什么都没留下…
展开
-
JDK 1.8 LinkedList中双向迭代器实现细节小记
在学习LinkedList源码时,发现对它的内部迭代器ListItr的实现有几个函数费了一番脑筋,记录下来供以后复习使用。这几个函数是next()、previous()以及remove()。先把它们的源码贴上来:public E next() { checkForComodification(); if (!hasNext())原创 2016-03-31 22:14:45 · 572 阅读 · 0 评论 -
jdk 1.7中HashMap的HashIterator实现细节小记
先贴上实现的源码: private abstract class HashIterator<E> implements Iterator<E> { Entry<K,V> next; // next entry to return int expectedModCount; // For fast-fail int index;原创 2016-04-03 21:53:17 · 1593 阅读 · 0 评论 -
java 1.8 ArrayList容量增长方式
/** * Increases the capacity of this ArrayList instance, if * necessary, to ensure that it can hold at least the number of elements * specified by the minimum capacity argument. *原创 2016-03-22 16:53:49 · 819 阅读 · 0 评论 -
找到大于一个正整数N的最小2的次幂数
在看JDK1.7中ArrayDeque源码时,有一个函数是这样写的: private void allocateElements(int numElements) { int initialCapacity = MIN_INITIAL_CAPACITY; // Find the best power of two to hold elements. /原创 2016-04-06 16:14:11 · 4400 阅读 · 0 评论 -
欢迎使用CSDN-markdown编辑器
欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl转载 2017-11-27 13:21:09 · 173 阅读 · 0 评论