Static variables in C#

前端 未结 5 689
梦如初夏
梦如初夏 2021-01-17 11:28

In C#, is there a way to put a static variable in a method like VB.Net?

Static myCollection As Collection
5条回答
  •  遇见更好的自我
    2021-01-17 12:01

    The closest thing to VB.NET's Static is to create a field in the current type. Other than that C# has no equivalent.

提交回复
热议问题