小编use*_*010的帖子

不包含带2个参数的构造函数?

我目前正在做一些类编码,并想知道我的项目出了什么问题?

class ContactPerson
{
    string name;
    ContactNo telNo;

    public ContactPerson(string in_Name, ContactNo in_No)
    {
        name = in_Name;
        telNo = new ContactNo();


    }
    public string getName()
    {
        return name;
    }
    public ContactNo getContactInfo()
    {
        return telNo;
    }
    public void setName(string in_Name)
    {
        name = in_Name;
    }
    public void setContactInfo (ContactNo in_No)
    {
        telNo = in_No;
    }
}
Run Code Online (Sandbox Code Playgroud)

}

class ContactNo
{
    string contactType;
    string contactNo;

    public void setContactType(string in_Type)
    {
        contactType = in_Type;
    }
    public string getContactType()
    {
        return contactType;
    } …
Run Code Online (Sandbox Code Playgroud)

c# class

-3
推荐指数
1
解决办法
1万
查看次数

标签 统计

c# ×1

class ×1