Threading and static methods in C#

后端 未结 3 1603
广开言路
广开言路 2021-02-19 20:54

Here is a meaningless extension method as an example:

public static class MyExtensions
{
    public static int MyExtensionMethod(this MyType e)
    {
        in         


        
3条回答
  •  心在旅途
    2021-02-19 21:25

    Quite simply, yes. A static method only means that the method can be called without an object. The local variables within the method are still local.

提交回复
热议问题