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

 

posted @ 2017-04-07 10:49  liusheng11188  阅读(1347)  评论(0)    收藏  举报