Java Memory Management
Java has automatic memory management that automatically performs garbage collection, which auto-release objects that are no longer in use to free up memory.
Java Memory Structure
- Stack: primitive types (int, char, …) and holds a reference to heap objects.
- Heap: actual objects, objects store their value inside the heap.

Algorithm Complexity