12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Linq;
- using System.Runtime.ConstrainedExecution;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleInterface
- {
- 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();
- }
- public class JHinfe : Infornation
- {
- string code = "";
- string name = "";
- public string Code
- {
- get { return code; }
- set { code = value; }
- }
- public string Name
- {
- get { return name;}
- set { name = value; }
- }
- public void ShowInfo()
- {
- Console.WriteLine("进货信息:" + code + " " + name);
- }
- //在派生类中,除了实现接口中的成员外,还可以编写其它的成员(方法、属性等)
- public int Show()
- {
- return 0;
- }
- }
- }
|