一、System系统操作类
1、System
1.1System类的简单介绍
- system没有构造方法
- 属性err,in,out都是为了得到一个流
- err、out都是用来输出信息的,在控制台输出我们想要输出的信息,都是一个printstream(标准输出流)
In是用来获取输入信息,得到一个inputstream
1.2System常用的方法
currentTimeMillis();
gc();
exit( int status); status状态----0,1
load( String filename);
该命令只能在32位操作系统运行,
getProperty(String key);
相关键值的对应如下所示
arraycopy(-,-,-,-,-,);
具体的代码演示如下:
//常用的方法
@Test
void test02() {
//获取系统当前时间,从1970.0.0到现在的毫秒值,与电脑同步
System.out.println("获取系统的当前时间"+System.currentTimeMillis());
//手动垃圾回收
System.gc();
//终止虚拟机的运行