java例子10:javadoc

javadoc很像doxygen


[root@gdc1000 java]# cat DocTest.java 
public class DocTest{
/* -------------------------------------------------*/
/** Descriptive phrase. Longer statement of purpose.
    <BR><B>Precondition:</B> Precondition goes here
    <BR><B>Postcondition:</B> Postcondition goes here
    @param p1 A description of this parameter
    @param p2 A description of this parameter
    @return A description of the return value
    */
    public int someMethod(double p1, String p2) {
		return 0;
    }

    public static void main(String[] args){

    }

}
[root@gdc1000 java]# 

执行如下

javadoc *.java

查看生成的结果


    Constructor Detail
        DocTest

        public DocTest()

    Method Detail
        someMethod

        public int someMethod(double p1,
                              java.lang.String p2)

        Descriptive phrase. Longer statement of purpose.
        Precondition: Precondition goes here
        Postcondition: Postcondition goes here

        Parameters:
            p1 - A description of this parameter
            p2 - A description of this parameter
        Returns:
            A description of the return value

        main

        public static void main(java.lang.String[] args)


有一个默认构造函数,说明可能是用反射方式生成的文档?(FIXME)



你可能感兴趣的:(java例子10:javadoc)