Memory management within loop
<p>I am creating <strong>table rows</strong> within a TableLayout in a loop which goes till the size of an array. The size of my array is 120. In the loop, an object of another class is created.  </p>

<pre><code>for(int i=0; i&lt;arrName.length; i++)
{
 MyClass *obj =new MyClass(this);
 /*

Some code  

*/
} 
</code></pre>

<p><strong>Question</strong>:  </p>

<p>1) How do I release the object I have created?<br>
2)Which default method is used to release objects created in an activity? (An example could be very useful)</p>
