title: How to check a variable holds Instance or Type in c#
body: <p>I have a class <code>Test</code> </p>
  
  <pre><code>public class Test { }
  </code></pre>
  
  <p>Now I have a variable <code>object1</code> which holds an instance of <code>Test</code>.</p>
  
  <pre><code>object object2 = new Test();
  
  // some code
  
  object2 = typeof(Test);
  </code></pre>
  
  <p><code>object2</code> will accepts both type and instance of <code>Test</code> class in different scenario. How can I check what value it holds. i.e. Instance of <code>Test</code> or Type of <code>Test</code></p>