using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace LearnThread
{
class Delay
{
public int timePass()
{
static int i=0;
for(i=0; i<100;i++)
{
Thread.Sleep(1000);
}
return i;
}
}
}
Error:The modifier 'static' is not valid for this item静态INT
为什么静态是错误吗?我们不能在int语言中使用static,因为我们可以在C语言中使用它?
因为C#是不是C. – leppie 2012-03-20 12:58:57
你怎么能指望一个实例方法的静态局部变量_inside_表现? – David 2012-03-20 12:59:25
另外,无论如何,“我”在那里静态有什么意义? – Matthew 2012-03-20 13:18:50