![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
源码阅读
文章平均质量分 84
flowciyu
SaaS
展开
-
图解Arraylist内存分配,以及底层实现,扩容性能分析
图解Arraylist内存分配,以及底层实现,扩容性能分析1:集合内存分配以及初始化过程图解2:源码解读ArrayList内部实现(数组结构)构造ArrayList的时候,默认初始化容量为10,保存容器为 Object[] elementData。向集合添加元素的时候,调用add方法,比如list.add("a");add方法做的操作是:elementData[原创 2013-05-20 23:21:17 · 7268 阅读 · 0 评论 -
Executors工厂类创建线程池的底层实现
上一篇介绍了ThreadPoolExecutor的基本使用,现在再来看看Executors工厂类的基本使用与底层实现方式。三种创建线程池的工厂方法源码:// 无界线程池public static ExecutorService newCachedThreadPool() { return new ThreadPoolExecutor(0, Integer.MAX_原创 2013-05-26 21:01:34 · 1989 阅读 · 0 评论