集合
Anakki
后端开发/风光摄影师/驴友/航拍手/后期小佬/火星居民
展开
-
解读ArrayList中的grow(int minCapacity)方法
查看源码: /** * Increases the capacity to ensure that it can hold at least the * number of elements specified by the minimum capacity argument. * * @param minCapacity the desired...原创 2019-01-10 21:24:50 · 6255 阅读 · 3 评论 -
ArrayList史上最详细源码分析
今天电话面试,面试官问到ArrayList中add方法的原理,我一下蒙了,这个用的最多的一种数据结构被我忽视了,没答上来,有时候用的最多的反而最自信,最自信的东西最容易忽视其中的细节,因此今天决定扒扒源码。 1 ArrayList是什么? 一种用来存放数据的数据结构。 它的底层是一个数组,用来存放数据。 2 ArrayList的特点? 底层为数组。 所存储的数据在内存中连续。 查询的...原创 2019-01-10 22:46:49 · 294 阅读 · 0 评论