using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Runtime.ConstrainedExecution; using System.Text; using System.Threading.Tasks; namespace ConsoleInterface2 { internal class Program { static void Main(string[] args) { Infornation info = new JHinfe(); info.Name = "手机"; info.Code = "001"; info.ShowInfo(); Console.ReadLine(); } } interface Infornation { string Code { get; set; } string Name { get; set; } void ShowInfo(); } interface Infornation2 { string Code { get; set; } string Name { get; set; } void ShowInfo(); } public class JHinfe : Infornation,Infornation2 { string code = ""; string name = ""; string Infornation.Code { get { return code; } set { code = value; } } string Infornation.Name { get { return name; } set { name = value; } } string Infornation2.Code { get { return code; } set { code = value; } } string Infornation2.Name { get { return name; } set { name = value; } } void Infornation.ShowInfo() { Console.WriteLine("进货信息:" + code + " " + name); } void Infornation2.ShowInfo() { Console.WriteLine("进货信息:" + code + " " + name); } //在派生类中,除了实现接口中的成员外,还可以编写其它的成员(方法、属性等) public int Show() { return 0; } } }