title: Does ArrayList.clear() method frees memory?
body: <p>If I'm not mistaken, ArrayList contains the value of memory locations in which the variables you've added to the List are stored. So, my assumption is that when you call ArrayList.clear() method it only frees the aforementioned values (of memory locations) but doesn't free those memory locations themselves. I'll try to illustrate this with an example:</p>
  
  <p>Let's say you've got current status of memory:</p>
  
  <pre><code>[Memory location] (type of variable) *value*
  
  [1000] (int) 32
  
  [1002] (int) 12
  
  [1003] (float) 2.5
  </code></pre>
  
  <p>And you add them to the list myList, so it contains pointers to the 1000, 1002, 1003 memory locations.</p>
  
  <p>When you call myList.clear() the pointers will be nullified, but the memory locations 1000, 1002, 1003 would still contain previously given values. Am I wrong?</p>