更加有趣的是:
如果你对此感兴趣,请自己深入探讨。
参考:
http://stackoverflow.com/questions/2986296/what-are-the-differences-between-arraylist-and-vector
更新:
我今天打开ArrayList的源码,(如上图所示)如果空间不够,再次分配时增加的空间大小为(oldCapacity >> 1)。
Vector和ArrayList的区别
最新推荐文章于 2020-10-07 20:14:58 发布