rip*_*234 4 java generics class
编辑 因为有许多downvotes和那些不理解我要求的人,我会改写:
我如何在运行时发现foo被泛化的类是什么?
public boolean doesClassImplementList(Class<?> genericClass)
{
// help me fill this in
// this method should return true if genericClass implements List
// I can't do this because it doesn't compile:
return genericClass instanceof List;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3123 次 |
| 最近记录: |