public class s
{
public string s1 { get; set; }
}
public class s2
{
public s s3 { get; set; }
}
class Program
{
static void Main(string[] args)
{
s2 objs2 = new s2();
objs2.s3.s1 = "asdf";
}
}
getting runtime error because objs2.s3 is null. i want to know how to achieve this.
Please also let me know why this is happening so if you got some time. thanks.