主题:[讨论]难以理解
class Test
{
public void main()
{
Console.WriteLine("the max of 6 and 8 is:{0}",max(6,8));
}
public int max(int x,int y)
{
if (x>y)
return x;
else
return y;
}
}
为什么这个不能运行啊,非要把两个public 都改成 static才行呢,不太明白
{
public void main()
{
Console.WriteLine("the max of 6 and 8 is:{0}",max(6,8));
}
public int max(int x,int y)
{
if (x>y)
return x;
else
return y;
}
}
为什么这个不能运行啊,非要把两个public 都改成 static才行呢,不太明白