Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在试图弄清楚如何在运行时确定泛型类型的类名,但也许我需要重新表述我对此的想法。
例如我有:
Map<String,Integer> map = new PersistentHashMap<String,Integer>();
我是否能够检索类名和java.lang.String例如?java.lang.IntegerPersistentHashMap
java.lang.String
java.lang.Integer
PersistentHashMap
由于类型擦除,这是不可能的。