public E[] obj;
public MyArray(Class<E> clazz, int capacity) {
//反射
obj = (E[]) Array.newInstance(clazz, capacity);
}
public E getPos(int pos) {
return obj[pos];
}
public void setObj(int pos, E val) {
obj[pos] = val;
}
public E[] getArray() {
return obj;
}
}