123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- 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;
- }
- }
- }
|