• system类


    system类(系统类)

    System类不能手动创建对象,因为构造方法被private修饰,阻止外界创建对象。System类中的都是static方法,

    常用的方法

    Static long currentTimeMillis();

    获取当前的毫秒值

    Static void exit(int );

    终止java虚拟机

    Static void gc()

    垃圾回收机制

    statac void arraycopy()(数组)

    练习

    public static void main(String[] args) {

    int[] src = new int[]{1,2,3,4,5};

    int[] dest = new int[]{6,7,8,9,10};

    System.arraycopy( src, 0, dest, 0, 3);

    代码运行后:两个数组中的元素发生了变化

    src数组元素[1,2,3,4,5]

    dest数组元素[1,2,3,9,10]

    }

    练习

    public static void main(String[] args) {

         long start = System.currentTimeMillis();

        for (int i=0; i<10000; i++) {

             System.out.println(i);

    }

    long end = System.currentTimeMillis();

    System.out.println("共耗时毫秒:" + (end-start) );

    }

  • 相关阅读:
    Daily Scrum – 1/15
    Daily Scrum – 1/12
    Daily Scrum – 1/11
    Daily Scrum – 1/7
    Daily Scrum – 1/6
    Daily Scrum – 1/5
    Daily Scrum – 1/4
    1/13 update
    stand up meeting 1--11
    stand up meeting 1-6
  • 原文地址:https://www.cnblogs.com/1997WY/p/10670226.html
Copyright © 2020-2023  润新知