title: Add a class object into another class in C#
body: <p>I have two classes, the one is called Degree and the other is called Uprogram. And I want to add a single variable in UProgram to hold a Degree object. How can I do it?
  <pre>
  class UProgram
      {
         //private member variables for UProgram
          private string programName;
          private string departmentName; </p>
  
  <pre><code>    //public properties for UProgram
      public string ProgramName
      {
          get { return programName; }
          set { programName = value; }
      }
      public string DepartmentName
      {
          get { return departmentName; }
          set { departmentName = value; }
      }  
  }
  </code></pre>
  
  <p>class Degree
      {
          //private member variables for Degree
          private string degreeType;
          private string degreeName;</p>
  
  <code>   //public properties for Degree
      public string DegreeType
      {
          get { return degreeType; }
          set { degreeType = value; }
      }
      public string DegreeName
      {
          get { return degreeName; }
          set { degreeName = value; }
      }
  }
  </code></pre>
  
  <p></p>