Please explain what is Heap and what is Stack?

Submitted by: Muhammad
☛ Both are memory locations, wherein Heap is global and Stack is local.
☛ The Heap is application level while the Stack is thread-level.
☛ The Stack has a defined first-in-first-out stack structure, while the Heap does not have a defined data structure.
☛ Its size is defined at the time of its creation. For Heap, the size is defined when starting the application and for Stack, when creating a thread.
☛ Both can grow dynamically.
☛ The Stack is faster than the Heap. A stack is in “cache” and doesn't have to synchronize with other threads like the Heap.
☛ The Stack stores values while the Heap stores objects.
Submitted by: Muhammad

Read Online Senior .Net Developer Job Interview Questions And Answers