title: Checking if object is instanceof Class in function, which takes Class as parameter
body: <p>I am learning RTTI in Java and I wrote a function like that:</p>
  
  <pre><code>static void select(Shape s, Class c)
  {
     if(s instanceof c)
     s.setSelected(true);
  }
  //Calling function: select(shape0, Circle);
  </code></pre>
  
  <p>The problem is, I have no idea if passing Class as paremater is possible? Compilator says it's error, it can't find c. So I used different code to solve this problem:</p>
  
  <pre><code>static void select(Shape s,Object obj)
  {
      if(s.getClass().equals(obj.getClass()))
      s.setSelected(true);
  }
   //Calling function: select(shape0, new Circle());
  </code></pre>
  
  <p>But I was wondering if something like first example is possible?</p>