title: c# clearing a list vs assigning a new list to existing variable
body: <p>I am learning C#.</p>
  
  <p>If I first make a variable to hold a list.</p>
  
  <pre><code>List&lt;int&gt; mylist = new List&lt;int&gt;();
  </code></pre>
  
  <p>Say I did some work with the list, now I want to clear the list to use it for something else. so I do one of the following:</p>
  
  <p>Method 1:</p>
  
  <pre><code>mylist.Clear();
  </code></pre>
  
  <p>Method 2:</p>
  
  <pre><code>mylist = new List&lt;int&gt;();
  </code></pre>
  
  <p>The purpose is just to empty all value from the list to reuse the list.</p>
  
  <p>Is there any side effect with using method2. Should I favor one method to the next. </p>
  
  <hr>
  
  <p>I also found a similar question,
  <a href="https://stackoverflow.com/questions/3106537/using-the-clear-method-vs-new-object">Using the &quot;clear&quot; method vs. New Object</a>
  I will let other readers decide what's best for their own use case. So I won't pick a correct answer.</p>