• c#抽象类


    using System;
    using System.Collections.Generic;
    using System.Linq;abstract抽象
    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("进货信息: "+Code+""+Name);
            }
        
        }
        public class SHinfo : information
        {
            public override void Showinfo()
            {
                Console.WriteLine("销售信息: "+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();
            }
        }
    }
  • 相关阅读:
    python 关于mysql 的 API pymysql
    Mysql
    Django的流程和命令行工具
    float属性 与position(定位)
    CSS的优先级与继承
    CSS的引入方式及选择器
    Html5 杂项
    Spring AOP之注解实现
    Spring AOP之xml 配置实现
    Java 正则表达式
  • 原文地址:https://www.cnblogs.com/qufeiba/p/6896565.html
Copyright © 2020-2023  润新知