计算运行程序所花费的时间:
Long startTime=System.currentTimeMillis();
int sum=0; //声明变量
for(int i=0;i<30000000;i++){ //执行累加操作
sum+=i;
}
long endTime=System.currentTimeMillis();
long time=endTime-startTime;
System.out.println(time+"毫秒");
列出本机的全部系统属性:
System.getProperties().list(System.out);
列出对应的属性:
System.getProperty("key word");
在对象被回收之前,还有一点内容被输出,则覆写Object中的
protected void finalize()throws Throwable