小禾斗 发表于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");
}
}
感觉依然不对
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()
{
}
}