title: adding object into a list without declaration
body: <p>This is the class whose instance I want to insert in the list.</p>
  
  <pre><code>public class Abc
  {
      public int x = 4;      
  }
  </code></pre>
  
  <p>List is made in Program class. How to insert data into list of <code>Abc</code> type without using the commented line.</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          List&lt;Abc&gt; list = new List&lt;Abc&gt;();
          // abc x = new Abc(); without doing this.
  
          list.Add(x); //add data to the list of class type abc      
      }
  }
  </code></pre>