C#结构函数与base关键字

 //声明父类
    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)
        { 

        }
    }

 

posted @ 2015-05-22 22:39  自由无风  阅读(243)  评论(0编辑  收藏  举报