变量范围学习案例
来源:岁月联盟
时间:2004-09-13
public class ScopeTest
{
public static int Main()
{
for(int i=0;i<10;i++)
{
Console.WriteLine(i);
} //i goes out of scope here
//u should can be declare a variable named i again,because
//there's no other variable with that name in scope
for(int i=9;i>=0;i--)
{
Console.WriteLine(i);
} //i goes out of scope here
return 0;
}
}
上一篇:.NET下的POP3编程
下一篇:在C#中如何读写INI文件