文件名称:子类调用父类的构造函数用于赋值.pdf
文件大小:226KB
文件格式:PDF
更新时间:2022-09-09 16:34:09
子类调用父类的
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication6 { public class employee { #region private string name; public string Name { get { return name; } set { name = value; } } private string id; public string Id { get { return id; } set { id = value; } } private int age; public int Age { get { return age; } set { age = value; } } private string gender; public string Gender { get { return gender; } set { gender = value; } } #endregion public employee(string name,string id,int age,string gender) { this.Name = name; this.Id = id; this.Age = age; this.Gender = gender;