Why does a static constructor not have any parameters?

前端 未结 9 1643
忘掉有多难
忘掉有多难 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:25

    Because you can't call it directly (as per MSDN):

    A static constructor cannot be called directly.

提交回复
热议问题