getters and Setters in c#
<p>Can anyone tell me what this Console application does? What is actually happening? </p>

<p>Also, There are errors. Can you please fix them?</p>

<pre><code>public class Program
{
    static void Main(string[] args)
    {
        Name n = new Name[5]; // error
        n[0] = new Name(0); //error
        n[0] = "hgfhf"; //is this possible in this program?
        string nam = n[0];
    }
}
public class Name
{
    private string[] name;
    private int size;
    public Name(int size)
    {
        this.name = new string[size];
        this.size = size;
    }
    public string this[int pos] // what does this mean?
    {
        get
        {
            return name[pos];
        }
        set
        {
            name[pos] = value;
        }
    }
}
</code></pre>
