Skip to main content
This is lesson 3 of 6 in this module 3/6

Heap Memory

We introduce heap memory and contrast it with the stack using a refactored drawPolygon example that allocates a Line array on the heap, showing how local variables on the stack hold references to heap objects and why a garbage collector is necessary.

Video lesson

Want to watch this lesson?

This lesson is part of the study plan. Get instant access to all lectures, labs and practice exams.

Get the Study Plan