//声明父类 class ProductsFather { public double Price { get; set; } public int Count { get; set; } public string Id { get; set; } //给字段赋值 c#结构函数 public ProductsFather(double price, int count, string id) { this.Price = price; this.Count = count; this.Id = id; } }
class Xiangjiao:ProductsFather { public Xiangjiao(double pirce, int count, string id) : base(pirce, count, id) { } }
时间: 2024-10-23 21:08:08