![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
手工实现ArrayList
手工实现ArrayList
清晨叫醒我
这个作者很懒,什么都没留下…
展开
-
手工实现ArrayList4(增加remove移除方法)
手工实现ArrayList4(增加remove移除方法)public class SxtArrayList05<E> { private Object[] elementData; private int size; public static final int DEFAULT_CAPACITY=10; public SxtArrayList05() { elementData = new Object[DEFAULT_CAPACITY]; } public SxtArray原创 2020-10-31 17:28:08 · 123 阅读 · 0 评论 -
手工实现ArrayList3(增加set,get以及索引越界检查)
手工实现ArrayList3(增加set,get以及索引越界检查)public class SxtArrayList04 <E>{ private Object[] elementData; private int size; public static final int DEFAULT_CAPACITY=10; public SxtArrayList04() { elementData = new Object[DEFAULT_CAPACITY]; } public Sxt原创 2020-10-31 17:25:44 · 95 阅读 · 0 评论 -
手工实现ArrayList2(增加数组扩容方法)
手工实现ArrayList2(数组扩容)public class SxtArrayList03 <E>{ private Object[] elementData; private int size; public static final int DEFAULT_CAPACITY=10; public SxtArrayList03() { elementData = new Object[DEFAULT_CAPACITY]; } public SxtArrayList03(i原创 2020-10-31 17:19:50 · 781 阅读 · 0 评论 -
手工实现ArrayList(最简化方式)
手工实现ArrayList(最简化方式,增加泛型)public class SxtArrayList <E>{ private Object[] elementData; private int size; public static final int DEFAULT_CAPACITY=10; public SxtArrayList() { elementData = new Object[DEFAULT_CAPACITY]; } public SxtArrayList(in原创 2020-10-31 17:17:07 · 125 阅读 · 0 评论