title: Is there any difference between declare variable in/out for?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1884906/declaring-a-variable-inside-or-outside-an-foreach-loop-which-is-faster-better">Declaring a variable inside or outside an foreach loop: which is faster/better?</a>  </p>
  </blockquote>
  
  
  
  <p>Hi all,</p>
  
  <p>What is the difference between two examples or is there any?</p>
  
  <p>Ex 1:</p>
  
  <pre><code>for (int i = 0; i &lt; 2; i++)
  {
      Thread newThread = new Thread( ... );
      newThread.Start();
  }
  </code></pre>
  
  <p>Ex 2:</p>
  
  <pre><code>Thread newThread;
  for (int i = 0; i &lt; 2; i++)
  {
      newThread = new Thread( ... );
      newThread.Start();
  }
  </code></pre>
  
  <p>their IL codes are same...</p>