initializing a class using a property in c# -
<p>I dont understand properties very well. the line of code: method2(x.str1, x.str2, x.str3, x.str4); --- throws me a "object reference not set to an instance of the 
object error". Any thoughts appreciated. x.str1 is not resolving?</p>

<p>(I am adding some code and adding more functionality to an existing set up. I would have initialized the class myProperty using methods and properties.)</p>

<p>using otherC# </p>

<pre><code>   class Test{

    private myProperty x;

    private string  str1, str2, str3, str4;

    private myProperty A
            {

                get { return x; }          

                set
                {

                    str1 = value.str1;
                    str2 = value.str2;
                    str3 = value.str3;
                    str4 = value.str4;

                }             
            }

    public void myMethod()
        {

               Test tst = new Test();
               myProperty x = new myProperty();
               //Assigning property varaibles:
                  x.str1 = "this";
                  x.str2 = "is";
                  x.str3 = "my";
                  x.str4 = "test";

               try
                {

                    tst.method2(x.str1, x.str2, x.str3, x.str4);
                }
                catch(Exception)
                {
                    throw;
                }
            }

    public void method2(string str1, string str2,string str3, string str4)
     {
     }

    }

    OtherC#.cs  contains the definition for myProerty class

    namespace temp
    {
    public class xyx {some code;}
    public interface abc {some code};
    public class myProperty {

            public string str1 { get; set; }

            public string str2 { get; set; }

            public string str3 { get; set; }

            public string str4 { get; set; }
    }
    }
</code></pre>
