Getting error with genric for define genric type variable in java
Define variable with genric type
Example with generic, normal, main class
//Generic Class
public class A <T> {
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<B>.class); //getting error not resolved A<B> generic type
}
public <T> static void doSomeOpration(Class<T> clazz) {
//Do Some opration with clazz
}
}