为什么我必须在方法内初始化变量?
int test1; // Not initialized, but ok
public int Foo()
{
int test2; // Not initialized
int test3 = test1; // Ok
int test4 = test2; // An error
}
Run Code Online (Sandbox Code Playgroud) c# ×1