title: How to get rid of namespace.Classname on call of display()?
body: <p>Is there a way to get rid of <code>practise.AcademicProgram</code> in the output when the <code>display()</code> is called for an object initialized by the parameterized constructor. In my code below this occurs when <code>s2.Display();</code> is executed.</p>
  <p>Below is my working code for the same:</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace practise
  {
      public class AcademicProgram 
      {
          //Memnber variables
          private int programCode;
          private string programName;
          private int programCredits;
  
          //Properties for reading and writting the values of private fields
          public int ProgramCode { get =&gt; programCode; set =&gt; programCode = value; }
          public string ProgramName { get =&gt; programName; set =&gt; programName = value; }
          public int ProgramCredits { get =&gt; programCredits; set =&gt; programCredits = value; }
  
          //Default Constructor
          public AcademicProgram()
          {
          }
  
          //Parameterized Constructor
          public AcademicProgram (int programCode, string programName, int programCredits)
          {
              this.programCode = programCode;
              this.programName = programName;
              this.programCredits = programCredits;
          }
  
          public void DisplayResults()
          {
              Console.WriteLine(&quot;Program Code: {0}\nProgram Name: {1}\nProgram Credits: {2}\n&quot;, programCode, programName, programCredits);
              Console.WriteLine();
          }
  
      }
  
      public class Instructor
      {
          //Member variables
          public string forename;
          public string surname;
          public int identificationNumber;
          public AcademicProgram  academicProgram;
  
          //Default Constructor
          public Instructor()
          {
              this.forename = string.Empty;
              this.surname = string.Empty;
              this.identificationNumber = 0;
              this.academicProgram = null;
          }
  
          //Parameterized Constructor
          public Instructor(string forename, string surname, int identificationNumber, AcademicProgram  academicProgram)
          {
              this.forename = forename;
              this.surname = surname;
              this.identificationNumber = identificationNumber;
              this.academicProgram = academicProgram;
          }
  
          // Member Function to display values of member variables on Console.
          public void Display()
          {
              Console.WriteLine(this.forename + &quot;, &quot; + this.surname + &quot;, &quot; + this.identificationNumber + &quot;, &quot; + this.academicProgram);
              Console.WriteLine();
          }
  
          //Driver function
          static void Main(string[] args)
          {
              //Instantiating object to call non-static member method
              Instructor p = new Instructor();
              p.Go();
              Console.ReadKey();
          }
  
          //Non-static Member function
          public void Go()
          {
  
              //Instantiating object without passing any values on runtime.
              Instructor s = new Instructor();
  
              //Instantiating object of AcademicProgram  class without passing any values on runtime.
              AcademicProgram  progName = new AcademicProgram ();
  
              //Set the values of fields using properties
              progName.ProgramCode = 8230;
              progName.ProgramName = &quot;Systems Development: Cocnepts and Analysis&quot;;
              progName.ProgramCredits = 4;
  
  
              // Instantiating object while providing values on runtime.
              Instructor s2 = new Instructor(&quot;Eddie &quot;, &quot;Jessup&quot;, 2394589, progName);
  
              //Call to display method 
              s.Display();
              s2.Display(); 
              progName.DisplayResults();
          }
      }
  }
  </code></pre>
  <p>Which gives an output shown <a href="https://i.stack.imgur.com/j85d1.png" rel="nofollow noreferrer">here</a></p>