How does a static constructor work?

前端 未结 10 1310
迷失自我
迷失自我 2020-12-04 06:03
namespace MyNameSpace
{
    static class MyClass
    {
        static MyClass()
        {
            //Authentication process.. User needs to enter password
                


        
10条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-04 07:01

    You can guarantee 4 will always come after 2 (if you don't create a instance of your class from your static method), however the same is not true for 1 and 3.

提交回复
热议问题