-2

我一直Unexpected end of declaration在空构造函数的右括号处得到“”。有人介意将我指向我不理解的方向吗?课程如下:

package info.welltrak.multi.vos;

import java.io.Serializable;

/**
* Value object model for drinking water systems.
*/
public class WaterSystemVo implements Serializable
{

    /** Empty constructor. */
    public WaterSystemVo()
    { 
    }

    /** Full constructor. *//
    public WaterSystemVo(int id, String systemId, String systemName)
    {
        mId = id;
        mSystemId = systemId;
        mName = systemName;
    }

    public static final long serialVersionUID = 1L;

    private int mId;
    /** Get record id. */
    public int getId(){ return mId; }
    /** Set record id. */
    public void setId(int id){ mId = id; }

    private String mSystemId;
    /** Get water system id number. */
    public String getSystemId(){ return mSystemId; }
    /** Set water system id number. */
    public void setSystemId(String systemId){ mSystemId = systemId; }

    private String mName;
    /** Get water system name. */
    public String getName(){ return mName; }
    /** Set water system name. */
    public void setName(String name){ mName = name; }
}
4

4 回答 4

1

你有一个额外/的评论行:

/** Full constructor. *//
于 2014-06-23T13:16:52.890 回答
1

更改此行

/** Full constructor. *//

如下

/** Full constructor. */
于 2014-06-23T13:17:09.293 回答
0

使用 javadoc 注释作为 -/** This is a comment *//** This is a comment *//

所以 /** Full constructor. *// 改成 /** Full constructor. */ ie

 /** Full constructor. */
        public WaterSystemVo(int id, String systemId, String systemName)
        {
            mId = id;
            mSystemId = systemId;
            mName = systemName;
        }
于 2014-06-23T13:18:26.920 回答
0

是的,正如研究员所说:问题只是一个额外的斜线。

代替:

/** Full constructor. *//

和:

/** Full constructor. */

并尝试使用:

// For Single Line Comments
于 2020-08-26T23:50:34.133 回答