必赢亚洲手机app下载


面向对象编制程序

搭建开发板的测试环境必赢亚洲手机app

c#抽象类

using System;

必赢亚洲手机app,using System.Collections.Generic;

using
System.Linq;必赢亚洲手机app 1

 

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();

        }

    }

}

 

相关文章

No Comments, Be The First!
近期评论
    功能
    网站地图xml地图