C# 静态方法调用实例方法

public class TestStatic
{
public int Add(int a, int b)
{
return a + b;
}

public static int MyAdd(int a, int b)
{
int result = new TestStatic().Add(a, b);
return result;
}

}

//调用

static void Main(string[] args)
{
Console.WriteLine(TestStatic.MyAdd(1,3));
Console.ReadLine();
}

原文地址:https://www.cnblogs.com/atkfc/p/15168629.html