标题:请教程序执行顺序问题
取消只看楼主
freebirdbo
Rank: 1
等 级:新手上路
帖 子:256
专家分:0
注 册:2005-3-27
 问题点数:0 回复次数:1 
请教程序执行顺序问题

class Class1
{

static string myString;

static void Write()
{
string myString = "String defined in Write()";
Console.WriteLine("Now in Write()");
Console.WriteLine("Local myString = {0}", myString);
Console.WriteLine("Global myString = {0}", Class1.myString);请问当程序执行到Class1.myString的时候 然后执行哪一句啊?
}

static void Main(string[] args)
{
string myString = "String defined in Main()";
Class1.myString = "Global string";
Write();
Console.WriteLine("\nNow in Main()");
Console.WriteLine("Local myString = {0}", myString);
Console.WriteLine("Global myString = {0}", Class1.myString);
}


}

搜索更多相关主题的帖子: 顺序 
2006-09-10 15:41
freebirdbo
Rank: 1
等 级:新手上路
帖 子:256
专家分:0
注 册:2005-3-27
得分:0 
感动
2006-09-11 13:32



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-89179-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.244245 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved