import java.util.Arrays;
public class Demo01 {
public static void main(String[] args) {
test1();
test2();
}
// 复制数组
// 复制src中指定位置开始指定长度到des中指定位置开始指定长度
private static void test2() {
int[] src = {1,2,3,4,5};
int[] des = {5,6,7,8,9};
System.arraycopy(src, 0, des, 0,3);
System.out.println(Arrays.toString(des));
}
// 打印当前时间
private static void test1() {
long s = System.currentTimeMillis();
for (int i = 0; i < 10000; i++) {
System.out.println(i);
}
long e = System.currentTimeMillis();
System.out.println("用时" + (e-s));
}
}