Java Memory Management
All local variables/primitives go on the stack. Every thread has its own stack. Heap Heap stores all Objects. So String, Integer etc are created on this. The references to these are given to the Stack. JAVA is Pass by Value. Every primitive variable created on stack is separate for each function and has a different […]