knowing get;set in c#
<p>I am writing following code,</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ReadOnlyObject
{
    class Program
    {
        private readonly int a = 20;
        private readonly int b;
        public int propa{get;private set;}

        public int propb { get; private set; }

        public Program(int tmp)
        {
                   b = tmp;
        }
        static void Main(string[] args)
        {
                   Program obj1 = new Program(30);

                   Console.WriteLine(obj1.propa);        // Console.WriteLine(obj1.a);

                   Console.WriteLine(obj1.propb);        // Console.WriteLine(obj1.b);

                   Console.Read();
        }
    }
}
</code></pre>

<p>After executing the above i got o/p as follows,</p>

<p>0<br>
0  </p>

<p>And when I change the code by replacing two commented statements printing direct member variables I got output as,</p>

<p>20<br>
30  </p>

<p>Why is so?
As far I know about properties they are associated with their definition in order the member variables are declared.</p>
