Skip to content
Mohamed Hassan (JOHN) edited this page Mar 11, 2025 · 4 revisions

Example:

Allocate an object in the heap:

Object objectName = new Object(); 

Memory management in high level programming languages on allocating composite data types in memory

Deallocate an allocated object from the heap:

objectName = null; // later the GC will reclaim the unreferred allocated objects

Memory management in high level programming languages on deallocating composite data types from memory

Clone this wiki locally