On Tue, 26 Feb 2008 02:31:20 -0800 (PST),
wrote,
quoted or indirectly quoted someone who said :
>I am new to Java Memory Model. I read that when I instantiate an
>object the memory for the object will be allocated in Heap and the
>identifier will be allocated in Stack.
Conceptually yes, but Jet for example sometimes allocated objects on
the Stack. This is an optimisation. The code behaves identically.
primitive local variables go on the stack. Local references and
parameters go on the stack. Objects go in the heap.
see
http://mindprod.com/jgloss/reference.html
http://mindprod.com/jgloss/stack.html
http://mindprod.com/jgloss/heap.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com