title: Creating new object in loop
body: <p>I am having a little C# beginner problem. But I'm pretty sure that it is easy to solve.</p>
  
  <pre><code>foreach(var test in Tests)
  {
       object testObj = new object();             
       //Do something with the object
  }
  </code></pre>
  
  <p>If i do it like that, the object testObj gets overwritten everytime i go through the loop. Is it possible to don't overwrite it everytime? 
  Or do I have to use an array?</p>
  
  <p>Edit: Ok sorry, I'll try to be more specific:
  My goal is that I create some objects in this loop and then I call a new thread with every object. There I want to do something with the object and when I'm done I'd like to release it.</p>
  
  <p>Edit2 for Thomas:</p>
  
  <pre><code>foreach (var test in Tests)
  {
       object testObj = new object();
       //Set some properties of the object
       Thread t = new Thread(() =&gt; manager(testObj));  
       t.Start();
  }
  
  public void manager(object testObj)
  {
      //Do something with the object
  
      //Release it
  }
  </code></pre>