Thursday, April 03, 2008

C# quiz 7/?

If we compile the following code to a dll, for example using the following command line:

csc.exe /t:library Library.cs

namespace Library {
public class Library {
public const int FOO = 1;
public static readonly int BAR = 2;
}
}

And refer those in our test program:

    class Program {
static void Main(string[] args) {
Console.WriteLine(Library.Library.FOO);
Console.WriteLine(Library.Library.BAR);
}
}

Now, if we change FOO to 10 and BAR to 12 and recompile Library.dll without recompiling the test program, what is the output when we run the test program?

No comments: