Does C# support the use of static local variables?

后端 未结 12 934
眼角桃花
眼角桃花 2020-12-14 17:28

Related: How do I create a static local variable in Java?


Pardon if this is a duplicate; I was pretty sure this would have been

12条回答
  •  旧巷少年郎
    2020-12-14 17:45

    Why not create a static readonly member on your class and initialize it in a static constructor maybe?

    This will give you the same performance benefit - it will only get initialised once.

提交回复
热议问题