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);
}
}