1class Foo<T> {
2 final Class<T> typeParameterClass;
3
4 public Foo(Class<T> typeParameterClass) {
5 this.typeParameterClass = typeParameterClass;
6 }
7
8 public void bar() {
9 // you can access the typeParameterClass here and do whatever you like
10 }