Why does a static constructor not have any parameters?

前端 未结 9 1543
忘掉有多难
忘掉有多难 2021-02-07 03:02

Per MSDN:

A static constructor does not take access modifiers or have parameters.

A static constructor is called automatically to ini

9条回答
  •  天涯浪人
    2021-02-07 03:32

    • Static Constructor is called automatically before first instance of the class is created.
    • Declared by prefixing a static keyword to the constructor definition.
    • It can not not take access modifiers or have any parameters.

提交回复
热议问题