Wednesday, April 28, 2010

6 important .NET concepts: - Stack, heap, Value types, reference types, boxing and Unboxing.

Introduction

What goes inside when you declare a variable?

Stack and Heap

By Val and By ref

So which data types are ref type and value type?

Boxing and Unboxing

Performance implication of boxing and Unboxing

Source code

---------
What goes inside when you declare a variable?

When you declare a variable in a .Net application, it allocates some chunk of memory in to the RAM. This memory has 3 things first the name of the variable, second data type of the variable and finally the value of the variable.

That was a simple explanation of what happens in the memory, but depending on what kind of data type your variable is allocated on that type of memory. There are two types of memory allocation stack memory and heap memory. In the coming sections we will try to understand these two types of memory in more details.

Read more: Codeproject

Posted via email from jasper22's posterous