c#基础 base和this的区别,在继承上面

base

  public Person(string name, int age, char gender)
        {
            this.Name = name;
            this.Age = age;
            this.Gender = gender;
        }

  public Student(string name, int age, char gender, int id)
            : base(name, age, gender)
        {
            //this.Name = name;
            //this.Age = age;
            //this.Gender = gender;
            this.Id = id;

base 下面就不用写了

this

原文地址:https://www.cnblogs.com/liuweiqiang11188/p/6677058.html