System类的概述和方法使用
long start = System.currentTimeMillis(); 程序开始执行的时间点 单位:毫秒
for(int i =0;i<1000;i++) {
System.out.println("*");
}
long end = System.currentTimeMillis(); 程序执行结束的时间点 单位:毫秒
System.out.println(end-start); 计算出程序执行耗时 单位:毫秒
System.gc();//运行垃圾回收器
System.exit(0);//正常终止,退出jvm虚拟机
int [] sarc = {11,22,33,44};
int [] dest = new int[4];
for(int i =0;i<dest.length;i++) {
System.out.println(dest[i]);
}
System.arraycopy(sarc, 0, dest, 0, sarc.length); 把老数组复制到新数组中
for (int i = 0;i<dest.length;i++) {
System.out.println(dest[i]);
}
添加微信进交流群: opiopi293