This article will explain six important concepts: stack, heap,
value types, reference types, boxing, and unboxing. This article
starts explaining what happens internally when you declare a
variable and then it moves ahead to explain two important
concepts: stack and heap. The article then talks about reference
types and value types and clarifies some of the important
fundamentals around them. The article concludes by demonstrating
how performance is hampered due to boxing and unboxing, with a
sample code. Watch my 500 videos on various topics like design
patterns, WCF, WWF, WPF, LINQ, Silverlight, UML, SharePoint,
Azure, VSTS, and a lot more: click here. You can also catch me
on my trainings Image taken from
http://michaelbungartz.wordpress.com/. What goes inside when you
declare a variable? When you declare a variable in a .NET
application, it allocates some chunk of memory in the RAM. This
memory has three things: the name of the variable, the data type
of the variable, and the value of the variable. That w