There are 2 kinds of heap - 1: a chunk of memory where data is stored and 2: a tree based data structure. When we talk about the heap and the stack we mean the first kind of heap. The stack is a LIFO data structure that stores variables and flow control information. Typically each thread will have its own stack.
|
|
Inappropriate
|
See Answer
To Email:
Subject:
Note to go along with the question: (Optional, no
more than 1,000 characters)
Boxing converts a value-type to a reference-type, thus storing the object on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.
Create Date
:
Tuesday, May 13, 2008
Click here
to improve the Interview Question, Answer and other fields.
|
|
Inappropriate
|
See Answer
To Email:
Subject:
Note to go along with the question: (Optional, no
more than 1,000 characters)
Garbage collection eliminates uneeded objects. the new statement allocates memory for an object on the heap.When no objects reference the object it may be removed from the heap (this is a non deterministic process).Finalize is called just before the memory is released.
Create Date
:
Tuesday, May 13, 2008
Click here
to improve the Interview Question, Answer and other fields.
|
|
Inappropriate
|
See Answer
To Email:
Subject:
Note to go along with the question: (Optional, no
more than 1,000 characters)
Converting a value type (stack->heap) to a reference type (heap->stack), and vise-versa.
Create Date
:
Tuesday, May 13, 2008
Click here
to improve the Interview Question, Answer and other fields.
|
|
Inappropriate
|
See Answer
To Email:
Subject:
Note to go along with the question: (Optional, no
more than 1,000 characters)
A reference type is known by a reference to a memory location on the heap.A value type is directly stored in a memory location on the stack. A reference type is essentially a pointer, dereferencing the pointer takes more time than directly accessing the direct memory location of a value type.
Create Date
:
Tuesday, May 13, 2008
Click here
to improve the Interview Question, Answer and other fields.
|
|
Inappropriate
|
See Answer
To Email:
Subject:
Note to go along with the question: (Optional, no
more than 1,000 characters)

CTS is an acronym for Common Type System which is an integral part of .net and which ensures language compatibility, interoperability and integration. Because .net treats all languages equal a class written in C# should be equivalent to class written in VB.net. Languages must agree on the meaning of these concepts before they can integrate with one another. To make this integration possible Microsoft has specified a common type system which every .net language must follow. There are two types in CTS: value type and reference type. Value types reference values on the stack. When a value type is passed to a function they are passed by value i.e. original value of the passed variable will not change. If a type consumes memory then it should be declared as a reference type. They contain references to heap based objects and are reclaimed by the garbage collector. When you pass a variable by reference then if the called function modifies it, it is visible in the calling function because it works on the actual object contrast to value type where a copy of the object is passed.
Create Date
:
Saturday, May 10, 2008
Click here
to improve the Interview Question, Answer and other fields.