title: Determining if an Object is of primitive type
body: <p>I have an <code>Object[]</code> array, and I am trying to find the ones that are primitives. I've tried to use <code>Class.isPrimitive()</code>, but it seems I'm doing something wrong:</p>
  
  <pre><code>int i = 3;
  Object o = i;
  
  System.out.println(o.getClass().getName() + ", " +
                     o.getClass().isPrimitive());
  </code></pre>
  
  <p>prints <code>java.lang.Integer, false</code>.</p>
  
  <p>Is there a right way or some alternative?</p>