Does C# support the use of static local variables?

后端 未结 12 954
眼角桃花
眼角桃花 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:53

    C# doesn't support static local variables. In addition to what has been posted above, here's a 2004 MSDN blog entry on the subject: Why doesn't C# support static method variables?

    (Same blog entry in the Microsoft's own archive. The Web Archive preserved the comments. Microsoft archive didn't.)

提交回复
热议问题