System类
System系统类,主要用与获取系统的属性数据和其他操作,构造方法时私有的
转自千锋教育
代码示例
public class Demo04 {
public static void main(String[] args) {
//arraycopy数组复制
//src 源数组;srcPos从哪个位置开始复制;dest目标数组;destPos目标数组的位置;length复制长度
//System.arraycopy(src,srcPos,dest,desPos,length);
int arr[]={1,2,3,4,5,6};
int dest[]=new int[6];
System.arraycopy(arr,0,dest,0,6);
for (int i=0;i<dest.length;i++){
System.out.println(dest[i]);
}
//可以用来计算程序块的运算时间
System.out.println(System.currentTimeMillis());
long start=System.currentTimeMillis();
for (int i =0;i<999999;i++){
i=i+1;
}
long end=System.currentTimeMillis();
long time=end-start;
System.out.println(time);
//退出jvm
System.exit(0);
}
}