1.編寫一小段程序,體會文檔注釋的用法,并通過文檔生成工具提取文檔注釋,形成程序文檔。
代碼如下:
//: Property.java
import java.util.*;
/** The first example program in "Thinking in Java."
* Lists system information on current machine.
* @author Bruce Eckel
* @author http://www.EckelObjects.com/Eckel
* @version 1.0
*/
public class Property {
/** Sole entry point to class & application
* @param args Array of string arguments
* @exception No exceptions are thrown
*/
public static void main(String args[]) {
System.out.println(new Date());
System.getProperties().list(System.out);
System.out.println("--- Memory Usage:");
Runtime rt = Runtime.getRuntime();
System.out.println("Total Memory = "
+ rt.totalMemory()
+ " Free Memory = "
+ rt.freeMemory());
}
} ///:~
利用Myeclipse生產(chǎn)javadoc文檔的步驟如下:
1.選擇File->Export->javadoc,下一步。
2.Javadoc comand選擇JDK的bin目錄下的javadoc.exe。選擇要生成的源代碼和javadoc保存的目的路徑,下一步。
3.Document title輸入標題,下一步。
4.overview輸入啟動指定的overview文件路徑,Extra Javadoc options輸入
-windowtitle 'Type B Monitor'[瀏覽器顯示標題]
-bottom <center>Travelsky</center>[底部顯示文本],
下一步。