23
votes
6answers
46k views

Stack and Heap memory in Java

As I understand , in Java, Stack memory holds primitives and method invocations and heap memory is used to store objects . Suppose I have a class class A { int a ; String b; ...