think in java 里面的一个小程序,帮忙解读一下谢谢。详细的。

蝴蝶Poj 2013-05-27 03:15:08

//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);
}
}

...全文
193 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
oh_Maxy 2013-05-27
  • 打赏
  • 举报
回复
3L说的对,如果方便的话,跟踪代码,看看源码也是不错的选择~
LCore 2013-05-27
  • 打赏
  • 举报
回复
引用 1 楼 zhaokewen05643 的回复:
//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.println("--Memory Usage--"); Runtime rt = Runtime.getRuntime(); System.out.println("Total memory = " + rt.totalMemory() + "Free memoty = " + rt.freeMemory()); } }
楼主要学会看API文档
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());
	}
}
渣受3T 2013-05-27
  • 打赏
  • 举报
回复

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());
	}
你的代码能运行? 这断代码的大概意思是输出系统当前时间,输出虚拟机的参数,输出总内存,空闲内存
蝴蝶Poj 2013-05-27
  • 打赏
  • 举报
回复
//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.println("--Memory Usage--"); Runtime rt = Runtime.getRuntime(); System.out.println("Total memory = " + rt.totalMemory() + "Free memoty = " + rt.freeMemory()); } }

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧