• 继承


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace day06
    {
        public class Fu
        {
            public string Name { get; set; }
            public int age { get; set; }
        }
    }
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace day06
    {
        public class Zi1:Fu
        {
            public string dd { get; set; }
            public void qq() { 
            Console.WriteLine("我叫{0},年龄{1},健康{2}",Name,age,dd);
            }
            
        }
    }
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace day06
    {
        class Program
        {
            static void Main(string[] args)
            {
                Zi1 zi = new Zi1();
                zi.Name = "hehe";
                zi.age = 10;
                zi.dd = "aaaaaaaa";
                zi.qq();   
            }
        }
    }
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace day06
    {
        public class zi21:Fu
        {
            public string aa { get; set; }
    
            public void bb()
            {
                Console.WriteLine("我叫{0},年龄{1},健康{2}", Name, age, aa);
            }
        }
    }

  • 相关阅读:
    CentOS-Docker安装RabbitMQ集群(rabbitmq:3.7.16-management)
    Xcode Shortcuts
    In App Purchase
    CoreData
    Sandbox 文件存放规则
    在 mac os 上搭建 git server
    Git
    Git and Xcode
    心算技巧
    AppleScript
  • 原文地址:https://www.cnblogs.com/qjt970518--/p/6567192.html
Copyright © 2020-2023  润新知