19.System类.md

System类

大量静态方法,系统相关信息,系统级操作

// currentTimeMillis方法
// 获取格林威治时间(1970年01月01日00:00点)到现在的毫秒差值

System.out.println(System.currentTimeMillis());

// arraycopy数组中指定的数组拷贝到另一个数组中
// arraycopy(
//   Object 源数组, 
//   int 源数组索引起始位置, 
//   Object 目标数组, 
//   int 目标数组索引起始位置, 
//   int 复制元素个数
// )

int[] scr = new int[]{1, 2, 3, 4, 5};
int[] dest = new int[]{6, 7, 8, 9, 10};
System.arraycopy(scr,0, dest, 0, 3);
for(int i : dest)
    System.out.println(i);

你可能感兴趣的:(19.System类.md)