Hi All,
I would like to ask a question regarding Java programming and memory handling. I want to ask if there is any way for the creator of a program to allocate and de allocate memory at any time he wills. Especesially deallocation matters. I know about java gc that is called automatically when we do not use any variable specified but what happens if in a long method we declare a string array and we use this many times (example this method is called many times in one application). When the first call is executed and the result is stored to this array is OK. After wards and in the meantime before reuse it how can I de allocate the captured memory? Another question regarding memory is the difference between the following declarations :
1) String []temp=new String[200];
2)String []temp=new String[200]; for (int i=0; i<temp.length; i++){temp[i]=null;} //This called any time the method is called.
Does null initialization helps in memory de allocation ?
This is a theory question moral less.
Thank you all for your time.
Regards
19world