zoukankan      html  css  js  c++  java
  • 子类继承父类有参的构造函数

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;

    namespace WebApplication1
    {
        public class Car
        {
            private string name;

            public string Name
            {
                get { return name; }
                set { name = value; }
            }
            public Car(string name)
            {
                this.Name = name;
            }
        }
        public class SmallCar : Car
        {
            public SmallCar(string aa)
                : base(aa)
            {
                this.Name = aa;
            }
        }
    }
  • 相关阅读:
    64最长和谐子序列(594)
    63找到字符串中所有字母异位词(438)
    62有效的数独(36)
    10.10
    9.27作业
    9.27
    9.26
    9.25
    9.18学习内容
    9.17作业
  • 原文地址:https://www.cnblogs.com/lilyzhang/p/1584480.html
Copyright © 2011-2022 走看看