title: class object null when declare is a class c#
body: <pre><code>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";
      }
  }
  </code></pre>
  
  <p>getting runtime error because objs2.s3 is null. i want to know how to achieve this. </p>
  
  <p>Please also let me know why this is happening so if you got some time.
  thanks.</p>