创建类和构造方法
public class MyArrayList {
private int [] elem;
private int usedSize;
public MyArrayList(){
this.elem = new int [10];
}
public MyArrayList(int capacity){
this.elem = new int[capacity];
}
}
创建类和构造方法
public class MyArrayList {
private int [] elem;
private int usedSize;
public MyArrayList(){
this.elem = new int [10];
}
public MyArrayList(int capacity){
this.elem = new int[capacity];
}
}