Class Model{ private T t; ..... private void someMethod(){ //now t is null Class c = t.getClass(); } ..... }
You can do this with reflection:
Field f = this.getClass().getField("t"); Class tc = f.getType();