阅读背景:

Java泛型:为什么编译器不能告诉这个Class 对象与这个类'type参数的对象的类有相同的类型?

来源:互联网 

Why do I need to cast the return of obj.getClass() to a Class<T> type when obj has type T? This also generates a warning, which I have silenced. But I feel like this shouldn't be necessary. What's going on here?Why do I need to cast the return of obj.getClas




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: