已有11人关注
直到课程讲完没有排除程序中错误,该如何排除这个错误
发表在C#视频课程答疑 2020-06-28
是否精华
版块置顶:


分享到:
精彩评论 3
小禾斗
学分:7308 LV13
TA的每日心情
奋斗
2017-04-21 14:00:25
2020-06-29
沙发

前面加上显式接口名

lining
学分:3 LV1
2020-06-29
板凳

小禾斗 发表于2020-06-29 16:46

前面加上显式接口名

 interface Information
    {
        string Code { set; get; }
        string Name { set; get; }
        void ShowInfo();

    }

    interface Information2
    {
        string Code { set; get; }
        string Name { set; get; }
        void ShowInfo();

    }

    public class Jhinfo:Information,Information2
    {
        string code="";
        string name = "";
      string Information.Code
        {
            get
            {
                return code;

            }
            set
            {
                code = value;
            }

        }
       string Information.Name
        {
            get
            {
                return name;
            }
            set
            {
                name = value;
            }
        }
    void Information.ShowInfo()
        {
            Console.WriteLine(Information.Code + Information.Code);
        }

        

            public void inf()
        {
            Console.WriteLine("ok");
        }

    }

image.png

感觉依然不对

小禾斗
学分:7308 LV13
TA的每日心情
奋斗
2017-04-21 14:00:25
2020-06-29
地板

interface Information

{

    string Code { get; set; }

    string Name { get; set; }

    void ShowInfo();

}

interface Information2

{

    string Code { get; set; }

    string Name { get; set; }

    void ShowInfo();

}


public class Jhinfo : Information, Information2

{

    string Information.Code { get; set; }

    string Information2.Code { get; set; }

    string Information.Name { get; set; }

    string Information2.Name { get; set; }


    void Information.ShowInfo()

    {

        Information i = new Jhinfo();

        Console.WriteLine(i.Code+i.Name);

    }


    void Information2.ShowInfo()

    {

        

    }

}

首页上一页 1 下一页尾页 3 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照