title: Methods with classname as a return type
body: <p>I'm new in c# or any type of programming language.
  When I see codes in c# I found there are lot of confusions are over here. one of them I want to clarify from here.
  Methods common structure is</p>
  
  <pre><code>&lt;modifier&gt;&lt;return type&gt;&lt;method name&gt;()
  {
  //do any thing
  return &lt;abc which should same as return type which declared above&gt;;
  }
  </code></pre>
  
  <p>in above said example I saw many times in <code>&lt;return type&gt;</code> use of <code>&lt;class name&gt;</code>, <code>&lt;dictionary&gt;</code> etc.
  but natural these are also user defined types. so this also should be here. But, never stood what happened actually here when we use "class name" in place of string or any data type?</p>
  
  <p>Please let me understand this with easy words, and easy examples.</p>
  
  <pre><code>class StockData
  {
      public int StockID { get; set; };
      public double CurrentPrice { get; set; };
      public string StockName { get; set; };
  }
  
  class GetStock
  {
      public StockData /*(this is the same name which is the class name above)*/ GetStockData(string symbol)
      {
          //something
          return /*(what will be the return type?)*/;
      }
  }
  </code></pre>