刚学习JAVA,这段简单程序为什么不能通过? 保存文件名为Property.javajavac Property.javajava Property 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 改成这样,把try那段去掉:import java.util.*;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 Memory = " + rt.freeMemory()); }} 正确的:import java.util.*;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 Memory = " + rt.freeMemory()); try { Thread.currentThread().sleep(5 * 1000); } catch(InterruptedException e) {} } } import java.util.*;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 Memory = " + rt.freeMemory()); try {Thread.currentThread().sleep(5 * 1000);} catch(InterruptedException e) {}}}改了一下,好用了,多了个'}',把try放到main里 文件解决了,是因为我将程序随便起了一个名字1.java结果编译不通过,改为Property.java就可以了。 在Java socket编程的时候,应该如何合理的关闭socket java socket编程关于client和server连接问题! 这类代码是干什么的 高手来帮帮忙 线程的中断,关闭与结束 考试题,拜托了 求你们了 只要结果就行了~ 由 FileInputStream 怎么得到 ByteArrayOutputStream ? 麻烦帮我看下有什么错!!! 求助:关于Eclipse 高手进来分析一下,不知道是不是java 还是 oracle的问题 .rar的文件如何打开???急 jbuilder恢复以前的版本,怎样加入history,怎样恢复到某一版本?
import java.util.*;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 Memory = "
+ rt.freeMemory());
}
}
import java.util.*;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 Memory = "
+ rt.freeMemory());
try {
Thread.currentThread().sleep(5 * 1000);
} catch(InterruptedException e) {}
}
}
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 Memory = "
+ rt.freeMemory());
try {
Thread.currentThread().sleep(5 * 1000);
} catch(InterruptedException e) {}
}
}
改了一下,好用了,多了个'}',把try放到main里