title: How I check if a variable is a "class" reference
body: <p>How do I check if a given variable is a <code>Class</code> (generic type)? I really don't know how to ask the question better, but let's consider this code:</p>
  
  <pre><code>Object[] o = new Object[] { "string", 12, MyClass.class, new MyClass() };
  
  for (int i = 0; i &lt; o.length; i++) {
      if (o[i] instanceof String) ...       // TRUE for [0]
      else if (o[i] instanceof Integer) ... // TRUE for [1]
      else if (o[i] instanceof ???) ...     // TRUE for [2] ???
      else if (o[i] instanceof MyClass) ... // TRUE for [3]
      else ...
  }
  </code></pre>
  
  <p>How do I check the type of the third element of the <code>o</code> array?</p>