C#类中的属性get和set


using System;
namespace HxRuntech
{
    public class T1
    {
        
        static void Main()
        {
            Student T1 = new Student();
            T1.Age = 34;
            Console.WriteLine(T1.Age);
        }
    }
    public class Student
    {
        int _age;
        public int Age
        {
            get
            {
                return _age;
            }
            set
            {

                _age = value;
            }
        }
    }
}