I read lot of articles about garbage collection and almost all article tells about heap memory. so my question is \"garbage collection collects stack memory or heap memory or bo
the stack is where your method arguments and local variables lie. if you leave the method, the stack pointer is automatically decremented (or incremented depending on the specific implementation). This is true for most programming languages.
garbage collection in contrast only works on the heap.