如果我在JavaDocs中使用,有人会杀了我吗?

我最近开始编写Java代码,我经常看到单个< p>用于分隔线条的标签.但就我的目的而言,我实际上并不想制作“段落”,而只是制作换行符,所以读取文档并不会那么糟糕.是< br>标签可以忍受吗?

最后,我想出了适合该项目的3种风格的文档.我会被杀的是什么?

>在代码中看起来不错,在文档查看中看起来不好

/**
 * <p> Does highly important adorable things.      </p>
 * <p> Not only helping fields in being suitable
 *     for stack overflowing, but also loves cats. </p>
 * <p> Please do not call while there are
 *     some elephants in the main class.           </p>
 */

>在代码和文档查看中看起来很糟糕

/**
 * Does highly important adorable things. <p>
 * Not only helping fields in being suitable
 * for stack overflowing, but also loves cats. <p>
 * Please do not call while there are
 * some elephants in the main class.
 */

>在代码和文档查看中看起来很好

/**
 * Does highly important adorable things. <br>
 * Not only helping fields in being suitable
 * for stack overflowing, but also loves cats. <br>
 * Please do not call while there are
 * some elephants in the main class.
 */

解决方法:

也许更清洁的选择是使用< pre>< / pre> (保持格式化):

/**
 * <pre>
 * Does highly important adorable things.
 * Not only helping fields in being suitable
 * for stack overflowing, but also loves cats.
 * Please do not call while there are
 * some elephants in the main class.
 * </pre>
 */
上一篇:Python 保存数据的方法:


下一篇:用于排序注释及其嵌套回复的MySQL查询