cxi読み取り専用フィールドと定数の違い、および静的構造関数の使用例



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

namespace ConsoleApplication1
{
    /// <summary>
    /// :it
    /// :c# ,
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(test.a);
            Console.WriteLine(test.b);
            Console.Read();

        }

   
    }
    public class test
    {
        public static readonly int b;// static , ,
        public const int a=1;// static ,

       static test()// , ,
        {

            b = 2;// , , static ,
        }
        void aa()
        {
            //a = 1;
            //b=1;
        }

       
    }
}