title: Display a variable from a class in the console?
body: <p>I have written the following code, but I want to make sure a property can protect the original value of the variables <code>m_id</code> and <code>m_name</code>. Is there a way to display those two variables in the console? Thanks!</p>
  
  <pre><code>using System;
  
  public class Customer
  {
      private int m_id = -1;
  
      public int GetID()
      {
          return m_id;
      }
  
      public void SetID(int id)
      {
          m_id = id;
      }
  
      private string m_name = string.Empty;
  
      public string GetName()
      {
          return m_name;
      }
  
      public void SetName(string name)
      {
          m_name = name;
      }
  }
  
  public class CustomerManagerWithAccessorMethods {
      public static void Main()
      {
          Customer cust = new Customer();
  
          cust.SetID(1);
          cust.SetName("Amelio Rosales");
  
          Console.WriteLine(
              "ID: {0}, Name: {1}",
              cust.GetID(),
              cust.GetName());
  
          Console.ReadKey();
      } }
  </code></pre>