title: Understanding Get and Set Accessors
body: <p>I'm a newbie and I'm trying to learn the basics of C#. This might sound quite trivial and may be stupid but its a doubt. While going through one of the source codes of an application, I saw a piece of code inside a class</p>
  
  <pre><code>private string fname;
  public string FirstName
  {
      get
      {
         return fname
      }
      set
      {
         fname = value;
      }
  }
  </code></pre>
  
  <p>Can anyone tell me what it means. I understand that when we declare a class we access <code>fname</code> using an alias <code>FirstName</code>. If it's for some security purpose then what?</p>