when the class is loaded in c#?
-
hi.. i have some question .. first one is i want to know when the class is loaded first time in c#? is it at compile time or at run time? and how? and where the memory is allocated to the class? and when the memory allocated for static fields ? and how?
-
hi.. i have some question .. first one is i want to know when the class is loaded first time in c#? is it at compile time or at run time? and how? and where the memory is allocated to the class? and when the memory allocated for static fields ? and how?
Hi Every static variable is stored on the heap, regardless of whether it's declared within a reference type or a value type. There is only one slot in total no matter how many instances are created. (There don't need to be any instances created for that one slot to exist though.) Note that this heap is separate from the normal garbage collected heap - it's known as a "high frequency heap", and there's one per application domain. For further reference please look this article http://www.developerfusion.co.uk/show/4705/2/[^]