62,614
社区成员
发帖
与我相关
我的任务
分享
//Property.java
improt java.uitl.*;
public class Perperty{
public static void main(String[] args){
System.out.println(new Date());
Properties p = System.getProperties();
p.list(System.put);
System.out.printin("--Memory Usage--");
Runtime rt = Runtime.getProperty();
system.out.prinln("Total memory = "+rt.totelMemory+"Free memoty = "+tr.freeMemoty);
}
}
package com.kiritor;
//Property.java
import java.util.Date;
import java.util.Properties;
public class Property {
public static void main(String[] args) {
System.out.println(new Date());//得到系统时间,无需多说
Properties p = System.getProperties();//得到相关属性
p.list(System.out);//将属性列表指定到System.out输出流
System.out.println("--Memory Usage--");
Runtime rt = Runtime.getRuntime();//得到运行时的一些信息
System.out.println("Total memory = " + rt.totalMemory()
+ "Free memoty = " + rt.freeMemory());
}
}
public static void main(String[] args){
System.out.println(new Date());
Properties p = System.getProperties();
p.list(System.out);
System.out.println("--Memory Usage--");
Runtime rt = Runtime.getRuntime();
System.out.println("Total memory = "+rt.totalMemory()+"Free memoty = "+rt.freeMemory());
}
你的代码能运行?
这断代码的大概意思是输出系统当前时间,输出虚拟机的参数,输出总内存,空闲内存