I just read this statement in a java book saying Objects in java reside on a heap. Is a heap used because it is the best way to store data and retrieve data fast ?
Why not store objects on the stack? Well, what happens to the stack after the currently executing method stops executing?