title: What's the C# equivalent of Java's Class<X> type?
body: <p>In Java, it's convenient for Class to have the generic parameter, X.  But C#'s Type class doesn't have this.</p>
  
  <p>So in C#, how does one do the equivalent of the following Java code?:</p>
  
  <pre><code>public &lt;X&gt; X methodThatReturns(Class&lt;X&gt; clazz) { ... }
  </code></pre>
  
  <p>There doesn't seem to be a way in C# to connect that return values, and the passed Type.</p>
  
  <p><strong>Clarification</strong><br>
  Several answers are suggesting the method parameter isn't necessary, because the method could simply be defined as <code>methodThatReturns&lt;X&gt;()</code>.</p>
  
  <p>But if you <em>do</em> have some unknown Type variable, <code>t</code>, there's basically no way to call such a generic method so that it will return an object of Type <code>t</code>?</p>
  
  <p>In Java, you're free to pass around <code>Class&lt;X&gt;</code> variables without losing the type information, but it seems that in C# if you pass around the equivalent <code>Type</code> variables, you can run into limitations, because you can't use them when you need to call generic methods.</p>