System类
1.exit()退出当前程序
1.exit 退出当前程序 System.out.println("ok1"); System.exit(0);//参数代表状态 ;0 代表正常退出 System.out.println("ok2"); //只会显示 ok2
2.arraycopy()复制数组元素
比较适合底层调用,一般情况下使用Arrays.copyOf()完成数组的复制
//arraycopy:复制数组元素,比较适合底层调用,一般使用Arrays.copyOf完成复制数组 int src[] ={1,2,3}; int dest[] = new int[3]; /*解析五个位置的含义 * 1.第一个位置:代表源素组 * 2.第二个位置:表示从源数组的哪个索引位置开始拷贝 * 3.第三个位置:代表目标数组 * 4.第四个位置:代表将源数组的数据拷贝到目标数组的哪个索引 * 5.第五个位置:从源数组拷贝多少个数据到目标数组去 * */ System.arraycopy(src,0,dest,1,2); for (int i = 0; i < dest.length; i++) { System.out.print(dest[i] + " "); }
3.currentTimeMillis返回当前时间距离1970-1-1的毫秒数
//currentTimeMillis :返回当前时间距离 1970-1-1 的毫秒数 System.out.println(System.currentTimeMillis());