为了账号安全,请及时绑定邮箱和手机立即绑定

如何在 java 文档中显示构造函数注释?

如何在 java 文档中显示构造函数注释?

蝴蝶刀刀 2022-09-28 16:04:17
我有一个类,其中包含一个带有获取器和 setter 的构造函数,并且需要为它们创建一个 javadoc。当我制作javadoc时,获取者和设置者都有他们的评论,但由于某种原因,构造函数没有出现在javadoc中。注意:我正在CMD中创建爪哇文档。我尝试过更改HTML版本,但仍然一无所获这是类的样子:/** * PersonalDetails class * * <p>Details the general information of a person involved in Saint Louis  University */public class PersonalDetails {    private String name;/** * Creates a person with the specified characteristics * @param name a String containing the name of the person * @param sy   a String specifying the current school year * @param idNo a String containing the id number of the person */PersonalDetails(String name, String sy, String idNo){    this.name = name;    this.sy = sy;    this.idNo = idNo;}/** * Registers the name of the person * @param name a String containing the name of the person */public void setName(String name) {    this.name = name;}/** * Retrieves the name of the person * @return a String representing the name of the person */public String getName() {    return name; }}我需要有块注释,以便构造函数个人详细信息显示在javadoc中。
查看完整描述

2 回答

?
缥缈止盈

TA贡献2041条经验 获得超4个赞

使用 -包标志调用 javadoc,以便它包含包私有 API 成员。

-package
仅显示包、受保护和公共类和成员。


查看完整回答
反对 回复 2022-09-28
?
手掌心

TA贡献1942条经验 获得超3个赞

将其设为公共

public PersonalDetails(String name, String sy, String idNo){

或配置 Javadoc,它也记录了您的包可见构造函数。


查看完整回答
反对 回复 2022-09-28
  • 2 回答
  • 0 关注
  • 124 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号