how objects and values are stored in java. i.e heap or stack.
can anyone explain the process how its stored.
posted 11 years ago
In general, member variables are on the heap, parameters and local variables in a method are on the stack. I almost never think about heap and stack (unless I do recursion wrong and blow up the stack.) I do think about scope ... does this information need to live beyond the method?
I recently read some quotes from one of the creators of Simula, a direct precursor to object oriented thinking. They just moved some data from the stack to the heap. They didn't think it was any big revolution, just a convenient place to store stuff they'd need again later.
Here's the first in a neat series getting Under The Hood of the JVM. It's a nice introduction to all kinds of JVM internals, even if it's a couple releases old now.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi