Heap is a dynamic memory block.
It is derived to store objects such as reference type instances.
Any object that is created in a method gets allocated in the Heap and returns that object reference.
During the execution of the program, Objects get filled in the Heap.
Cleaning of objects from the Heap is done by the runtime's Garbage Collector. This will helps our computer to perform faster.
Heap is capable of storing static fields and constants.
Asked In: Spotted While Learning |