Where are static members stored in memory? stack/ heap in C# .Net
This question already has an answer here:
When a static variable is allocated, it will be stored as part of Methodtable. Methodtable means When a class is loaded first time in application, separate memory will be allocated in appdomain for class level variables and methods inside class. .
If static variable is primitive type, it will be stored as part of Methodtable. If it is reference type, it will be stored inside the heap and the reference will be stored in Methodtable
链接地址: http://www.djcxy.com/p/82822.html上一篇: 免费商店“堆”这个词的起源是什么?