I have a class which accepts a generic parameter
class MyClass<D> {
public void myMethod() {
}
}
Now I have an external API method with the following signature?
public static <T> T apiMethod(String str, java.lang.Class<T> classOfT) {
}
I want something like the below, but I'm getting compilation error.
class MyClass<D> {
public void myMethod(String str) {
ApiClass.apiMethod(str,D);
}
}
Any idea of how can I achieve that?