System类

System类

此系列笔记来源于

BiliBili韩顺平老师的Java基础课


常用方法

1、System.exit(0); 退出当前程序

2、System.arraycopy() 数组拷贝

int src[] = {1, 2, 3};
int dest[] = new int[3];
System.arraycopy(src, 0, dest, 0, 3);//源数组、源数组的开始拷贝下标、目标数组、拷贝到目标数组的起点索引、从源数组拷贝多少个(length)

3、System.currentImeMillens() 返回当前时间距离1970.1.1的毫秒数

4、System.gc() 运行垃圾回收机制

posted @ 2022-04-11 12:27  Yra  阅读(28)  评论(0)    收藏  举报