Where to Declare and Instantiate a Member of Another Type?
<p>I am new-ish to C#, and I am looking at code for a ASP.NET web application where inside a class another class is initialzed. I was wondering what is the purpose for the way it was initialized, and when I should repeat this pattern -</p>

<pre><code>namespace MyNameSpace
{
   public class MyClass
   {
      private OutsideClass outsideClass;   //WHY IS THIS DECLARED HERE???

      public void MyMethod()
      {
         this.outsideClass = new OutsideClass();  //WHY IS THIS NOT DONE UNTIL HERE??? 
      }
   }
}
</code></pre>

<p>Can someone tell me what is accomplished by the two lines of code that have the comments next to them?  Why and when I would use code like that? </p>
