01. 注释和嵌入文档

Author Avatar
FengXueke 10月 18, 2022
post01

注释和嵌入文档

  • 代码如下
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//: Property.java
package com.isflee.first_java_app;

import java.util.Date;
import java.util.Properties;

//17章会用到
/** The first Thinking in Java example program.
* Lists system information on current machine.
* @author Bruce Eckel
* @author http://www.BruceEckel.com
* @version 1.0 */
public class Property {

/** Sole entry point to class & application
* @param args array of string arguments
* @return No return value
* @exception exceptions No exceptions thrown
*/
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());
}

}

  • 可以用 javadoc Property.java 命令生成对应的文档