Junilu Lacar wrote:Would T.getName() work?
In theory, T.getClass().getName() will get you the name of the class -- however, that class is not necessarly the T type of the generic. For example, it is possible to put a
Thread object in an ArrayList<Runnable>; getName() will get you "Thread", so you only know that the generic contain, at least one Thread object. You don't know what the T type of the colleciton is.
Henry