C#自动实现的属性

 

using System;
using System.Collections.Generic;
using System.Text;

namespace 自动属性
{
    class Program
    {
        static void Main(string[] args)
        {
            
        }
    }
    class Person
    {
        //定义可读写属性
        public string Name { get; set; }
        //定义可写属性
        public int Age { get; private set; }
    }
}

 

posted @ 2016-10-20 23:00  抢囡囡糖未遂  阅读(214)  评论(0编辑  收藏  举报