Hi All, Can anyone please give me a good link for a topic on memory allcoations in java as to, *)where are all the static objects of a class stored *)where are the methods stored during exection,I mean which part of memory. *)are members of a Ojects or instance methods and class methods or static methods stored on the same memory location during their execution? *)where are primitive types stored which are delcared as attribute of the class.
So for Ex,
where is the temp1,temp2,temp3 stored where is int a stored where is int b stored where is int c stored and whre are both of the methods of the above class stored while execution
Thanks All,Appreciate your valuable Time. [ September 18, 2006: Message edited by: Archies Gomes ]
Instance variables and Objects are stored in HEAP AREA and become a candidate for garbage collection after going out of scope.
Local var(whether static or not), methods reside on stack and are never Garbage collected. Its just that stack is reused once method execution is completed.
~ Pratibha Malhotra<br /> <br />Sun Certified Java Programmer<br />SCEA 1.4 (In Progress)<br />~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />"Many of life's failures are people who did not realize how close they were to success when they gave up!!"
Author and all-around good cowpoke
Joined: Mar 22, 2000
When you say
When methods are called they are moved to the stack for processing.
what do you think that means?? It sounded to me like an implication that method byte code is moved when a call is executed. Bill