How does a static constructor work?

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


        
10条回答
  •  暖寄归人
    2020-12-04 07:09

    Here's the actual order in which things go down:

    1. Start of Main
    2. Start of the static MyClass constructor
    3. End of the static MyClass constructor
    4. Start of MyMethod
    5. End of Main

提交回复
热议问题