package com.oracel.demo01; public class Sjzhhm { public static void main(String[] args) { method(); method1(); method2(); method3(); } public static void method(){ //统计程序执行时间 long start=System.currentTimeMillis(); for(int i=0;i<10000;i++){ System.out.println(i); } long stop=System.currentTimeMillis(); System.out.println("程序执行了"+(stop-start)); } public static void method1(){ while(true){ System.out.println("开始"); //终止程序执行 System.exit(0); } } public static void method2(){ Person p=new Person(); System.gc(); } public static void method3(){ String sys=System.getProperty("java.version"); String sys1=System.getProperty("java.home"); System.out.println(sys); System.out.println(sys1); } }