首页 > 编程语言 > 详细

java_15 System类

时间:2019-04-13 21:41:39      阅读:85      评论:0      收藏:0      [点我收藏+]

1.System类

  技术分享图片

2.System类方法

  (1)currentTimeMillis()
  技术分享图片

    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("------------");
		System.out.println(end - start);
	}

 技术分享图片
    (2)arraycopy(Object src, int srcPos, Object dest, int destPos, int length):   复制数组到目标数组

技术分享图片

    public static void main(String[] args) {
		int[] arr = {23,56,12,65,98};			//定义arr数组
		int[] resu = new int[3];				//定义长度为3的resu数组
		Arrays.sort(arr);						//将arr数组从小到大排序
		System.arraycopy(arr, 0, resu, 0, 3);//将arr数组中前3 个,即最小的3位数赋值给resu数组
		for (int i = 0; i < resu.length; i++) {	//打印
			System.out.print(resu[i]+"\t");
		}
	}

 技术分享图片

  (2)exit ();

技术分享图片
  (3)gc()

技术分享图片
  (4)getProperties()

技术分享图片

java_15 System类

原文:https://www.cnblogs.com/smxbo/p/10685466.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!