Java文档注释未完全显示

时间:2019-03-21 19:48:32

标签: java javadoc

因此,这是我的一个类中带有Java文档注释btu的代码片段,当我将其称为Java文档未完全显示时,只有第一个参数显示了其余参数,为什么呢?我究竟做错了什么?我需要正确格式化吗?

/**
     * @param String timestamp
     * @param int empire
     * @param int federation
     * @param int independent
     * @param int alliance
     */
    public ReputationEvent(String timestamp, int empire, int federation, int independent, int alliance) {
        super(timestamp);
        this.empire = empire;
        this.federation = federation;
        this.independent = independent;
        this.alliance = alliance;
    }

Calling Class to create new instance of it, not showing the full java doc comment

2 个答案:

答案 0 :(得分:2)

切换@param的顺序。通常您不会写变量的类型。

0

示例:

/**
 * <A short description of your method / class / whatever>
 *
 * @param <name of the variable> <describe your variable>
 */

Source

答案 1 :(得分:0)

语法是

@param <name of parameter> <description>

如果从示例中生成javadoc,则会出现以下错误:

  

错误:未找到@param名称* @param国际联合会

因为“ int”不是该参数的预期名称,即“联邦”。

相关问题