javaAPI(3)之System类简易

来源:互联网 发布:威尼斯共和国 知乎 编辑:程序博客网 时间:2024/06/08 12:49

这里写图片描述

import java.util.Enumeration;import java.util.Properties;public class APITestTwo {    public static void main(String[] args) {        long startTime=System.currentTimeMillis();        Properties properties=System.getProperties();        @SuppressWarnings("rawtypes")        Enumeration propertiesName=properties.propertyNames();        while(propertiesName.hasMoreElements()){            String key=(String)propertiesName.nextElement();            String value=System.getProperty(key);            System.out.println(key+">--"+value);        }        long stopTime=System.currentTimeMillis();        System.out.println("运行时间为:"+(stopTime-startTime)+"毫秒");        String[] fromoArrary={"Hello","my","baby","come","on"};        String[] toArrary={"Why","you","do","not","love","me","?"};        System.arraycopy(fromoArrary, 2, toArrary, 3, 2);        for(int i=0;i<toArrary.length;i++){            if(i!=toArrary.length-1){                System.out.print(toArrary[i]+",");            }            else{                System.out.print(toArrary[i]);            }        }    }}
原创粉丝点击