I wrote some code the looks like this:
public class A<T> {
public Type getGenericType() {
// should return the type of T at runtime
}
}
meaning, the call:
A<Integer> a = new A<>();
a.getGeneicType();
should return Integer
.
Is it possible in Java?
Aucun commentaire:
Enregistrer un commentaire