重写ArrayList类,为防止冲突,重写为MyArrayList,未继承Iterable类. public class MyArrayList<AnyType>{ int N=10; AnyType a[]; //定义一个数组,未分配空间 int theSize; public MyArrayList(){ clear(); } public void clear(){ theSize=0; increaseSpace(N); //对数组初始化,扩容为10 } public int size…