这篇文章给大家分享的是有关怎么才能调用System.arraycopy方法的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
重点是怎么才能调用System.arraycopy方法。
public class Cell {
private int v;
public Cell(int v) {
this.v = v;
}
public String toString() {
return String.valueOf(v);
}
}
ArrayListal = new ArrayList(10); al.add(new Cell(10)); al.add(new Cell(11)); al.add(new Cell(12)); al.add(new Cell(13)); al.add(new Cell(14)); Cell[] cells = new Cell[al.size()]; cells = al.toArray(cells); System.out.println("cells=" + Arrays.asList(cells)); | |
感谢各位的阅读!关于“怎么才能调用System.arraycopy方法”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!