随笔都是学习笔记
随笔仅供参考,为避免笔记中可能出现的错误误导他人,请勿转载。

System:

  - 数组拷贝: public static void arraycopx(Object src. int srcPos, Object dest,int destPos. int length);

  - 获取当前的日期时间数值: public static long currentTimeMillis();
public class Main {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        for (int i = 0; i < 1000; i++) {
            String s = "1.";
            s += i;
        }
        long end = System.currentTimeMillis();
        System.out.println("消耗时间:" + (end - start) + "ms");
    }
}
  - 进行垃圾回收: public static void gc();
这个gc()方法不是重新定义的方法,而是继续执行了Runtime中的gc()方法;gc()方法在整个系统中只有一个,就是RunRuntime找的gc()方法。

 

posted on 2022-02-03 14:14  时间完全不够用啊  阅读(73)  评论(0编辑  收藏  举报