靜態(tài)成員變量曾經(jīng)獲得垃圾回收嗎?例如,讓我們使用以下類。public class HasStatic { private static List<string> shared = new List<string>();}并假設(shè)它是這樣使用的://Startup{HasStatic a = new HasStatic();HasStatic b = new HasStatic();HasStatic c = new HasStatic();HasStatic d = new HasStatic();//Something}//Other code//Things deep GC somewhere in hereHasStatic e = new HasStatic();當a,b,c,和d被垃圾回收不靜態(tài)成員shared得到收集呢?可能e會得到一個新的實例shared?
- 3 回答
- 0 關(guān)注
- 312 瀏覽
添加回答
舉報
0/150
提交
取消