title: When to use get; set; in c#
body: <p>I'm failing to understand what the difference is between initializing a variable, getting its value like this:</p>
  
  <pre><code> //define a local variable.
     int i;
  
     i= 0;
     Console.WriteLine(i);
  </code></pre>
  
  <p>and the get; set; usage:</p>
  
  <pre><code>public int i
  {
     get;
     set;
  }
  
  i = 0;
  Console.WriteLine(i);
  </code></pre>
  
  <p>I've read some articles, but don't understand when I would use it.</p>