Static variable order [duplicate]
问题 This question already has answers here : Static field initialization order (C#) - can someone explain this snippet? (6 answers) Closed 7 years ago . I have aproblem with the order of static variable declaration in C# When i run this code: static class Program { private static int v1 = 15; private static int v2 = v1; static void Main(string[] args) { Console.WriteLine("v2 = "+v2); } } The output is: v2=15 But when i change the static variable declaration order like this: static class Program {