2
4

1 回答 1

4
  • JavaDoc 用于JavaDoc(和 IDE)。没有其他的。使其尽可能易读,因此请使用您列出的代码标签。
  • 其他代码注释应该有助于理解代码。由于它只是代码的一部分,并且只会与代码一起看到,因此不需要进一步的标记。

例子:

/**
 * This method returns <code>true</code> when the sun is shining.
 *
 * @param weather - A <code>package.name.Weather</code> implementation
 * representing the weather to be analyzed.
 * return <code>true</code> if the sun is shining, else <code>false</code>.
 */
public boolean isSunShining(Weather weather) {
    boolean result = false; // boolean variable for the result. Default is false.
    // some more code
    /*
     * Multiline comment w/o markup
     */
    return result;
}
于 2013-02-10T23:02:46.170 回答