How reference types are stored on heap in .NET? (means in which form) If in application have 2 objects with same name how those objects will stored on heap?
Ick - the fact that it propagates the "value types are stored on the stack" myth in big bold letters puts me off instantly.
Jon Skeet
2009-07-22 08:01:25
+5
A:
Objects don't have names. The references (on the stack or as fields inside objects) have names and they refer to the objects. But 1 object can have more than 1 reference pointing to it.
Henk Holterman
2009-07-22 07:49:50
+2
A:
It doesn't mattery how they are stored; how they are stored is an implementation detail. You should be concerned with the observable characteristics of types, not implementation details. Further reading:
http://blogs.msdn.com/ericlippert/archive/2009/04/27/the-stack-is-an-implementation-detail.aspx
Greg Beech
2009-07-22 08:20:29
A:
The only relevant concern about how objects are stored, in most run-times, is that objects are streams of bytes, which might be contigious, and the primary knowledge about the objects is in code that manipulate references to it.
Cecil Has a Name
2009-07-22 08:27:13