System类和Random类

时间:2023-03-08 19:03:22

System类

成员方法:

public static void gc():运行垃圾回收器

public static void exit(int status):退出垃圾回收器

public static long currentTimeMillis():返回以毫秒为单位的当前时间     这个重要  用于测试某个方法运行快慢

public static void arrarycopy(Object src,int srcPos,Object dest,int destPos,int length):从指定源数组复制一个数组,复制从指定的位置开始,到目标数组的指定位置结束

Random类

成员方法:

public int nextInt():返回int范围内的随机数。