Answers for "Get generic type of class at runtime"

0

Get generic type of class at runtime

public class GenericClass<T> {

     private final Class<T> type;

     public GenericClass(Class<T> type) {
          this.type = type;
     }

     public Class<T> getMyType() {
         return this.type;
     }
}
Posted by: Guest on July-16-2021

Code answers related to "Get generic type of class at runtime"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language