难道非要改成这个样子吗?谢谢using System;
public class Test
{
int x;
public static void SetX(int x)
{
x = x;
Console.Write(x);
} public static void Main()
{
SetX(3);
}
}
public class Test
{
int x;
public static void SetX(int x)
{
x = x;
Console.Write(x);
} public static void Main()
{
SetX(3);
}
}
public class Test
{
int x;
public static void SetX(int y)
{
Test t=new Test();
t.x = y;
Console.Write(t.x);
} public static void Main()
{ SetX(3);
}
}
public class Test
{
int x;
public void SetX(int x)
{
this.x = x;
Console.Write(x);
}public static void Main()
{
Test t = new Test();
t.SetX(3);
}
}