package test;
import java.util.Properties;
import java.util.Set;
public class test6 {
    public static void main(String[] args) {
        time();
        property();
        copy();
    }
    public static void property() {
        Properties properties = System.getProperties();
        System.out.println(properties);
        
        Set<String> propertynames = properties.stringPropertyNames();
        for (String key : propertynames) {
            System.out.println(key + "----->" + System.getProperty(key));
        }
    }
    public static void time() {
        long startTime = System.currentTimeMillis();
        int sum = 0;
        for (int i = 0; i < 100000000; i++) {
            sum += i;
        }
        long endTime = System.currentTimeMillis();
        System.out.println("程序运行时间为:" + (endTime - startTime));
    }
    public static void copy() {
        int[] source = {102, 102, 103, 104, 105, 106};
        int[] target = {201, 202, 203, 204, 205, 206, 207};
        System.arraycopy(source, 2, target, 3, 4);
        for (int i = 0; i < target.length; i++) {
            System.out.println(i + ":" + target[i]);
        }
    }
}
package test;
public class test7 {
    public static void main(String[] args) {
        Runtime runtime = Runtime.getRuntime();
        System.out.println(runtime.totalMemory());
        System.out.println(runtime.maxMemory());
        System.out.println(runtime.freeMemory());
        System.out.println(runtime.availableProcessors());
    }
}