get generic type of class at runtime

Solutions on MaxInterview for get generic type of class at runtime by the best coders in the world

showing results for - "get generic type of class at runtime"
Liam
02 May 2019
1public class GenericClass<T> {
2
3     private final Class<T> type;
4
5     public GenericClass(Class<T> type) {
6          this.type = type;
7     }
8
9     public Class<T> getMyType() {
10         return this.type;
11     }
12}
13
similar questions
queries leading to this page
get generic type of class at runtime