What is Stack & Heap? |
It is an array of memory.
It is a LIFO (Last In First Out) data structure.
In it data can be added to and deleted only from the top of it.
|
It is an area of memory where chunks are allocated to store certain kinds of data objects.
In it data can be stored and removed in any order.
|
What goes on Stack & Heap? |
"Things" declared with the following list of type declarations are Value Types
(because they are from System.ValueType):
bool, byte, char, decimal, double, enum, float, int, long, sbyte, short, struct, uint, ulong, ushort
|
"Things" declared with following list of type declarations are Reference Types
(and inherit from System.Object... except, of course, for object which is the System.Object object):
class, interface, delegate, object, string
|
How is the Block Allocated? |
Its block allocation is reserved in LIFO.
The most recently reserved block is always the next block to be freed.
|
Its block allocation is free and done at any time |