Member • May 18, 2013
A query related to Java objects
Classname object=new Classname();
Here an object will be created in heap and the reference to it will be stored in stack.After we close the program the reference is lost from stack but object still resides in heap(although the memory now is free for reallocation).
Is it correct?Because If it is, then only I will ask my further query.😁