title: How to define variable of generic class reference to pass the class into a method
body: <p>Getting error with genric for define genric type variable in java</p>
  
  <p>Define  variable with genric type</p>
  
  <p>Example with generic, normal, main class</p>
  
  <pre><code>//Generic Class
  public class A &lt;T&gt; {
      T t;
  
      //getter setter
  }
  
  //Normal class
  public class B {
      //Some variables
  }
  
  //Main Class
  public class C {
      public static void main(String[] args) {
          //Fine with normal class
          doSomeOpration(B.class);
  
          //Call doSomeOpration with genric class
          doSomeOpration(A&lt;B&gt;.class); //getting error not resolved A&lt;B&gt; generic type
      }
  
      public &lt;T&gt; static void doSomeOpration(Class&lt;T&gt; clazz) {
          //Do Some opration with clazz
      }
  }
  </code></pre>