标签:ace line log key rgs name namespace form ons
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 抽象类
{
public abstract class information//定义抽象
{
public string Code { get;set;}
public string Name { get; set; }
public abstract void Showinfo();
}
public class JHinfo : information
{
public override void Showinfo()
{
Console.WriteLine("进货信息:\n"+Code+""+Name);
}
}
public class SHinfo : information
{
public override void Showinfo()
{
Console.WriteLine("销售信息:\n"+Code+""+Name);
}
}
}
class Program
{
static void Main(string[] args)
{
JHinfo jh = new JHinfo();
SHinfo sh = new SHinfo();
jh.Code = "战神";
jh.Name = "笔记本电脑";
sh.Code = "荣耀100";
sh.Name = "华为手机";
jh.Showinfo();
sh.Showinfo();
Console.ReadKey();
}
}
}
c#抽象类
标签:ace line log key rgs name namespace form ons
原文地址:http://www.cnblogs.com/qufeiba/p/6896565.html