1、使用注解@SuppressWarnings("unchecked")
2、设置Eclipse警告忽略
Window->Preferences->Java->Compiler->Errors/Warning->Generic types中将
Unchecked generic type operation(或者 Usage of a raw type)设置为Ignore
<!--StartFragment -->
本文介绍如何通过使用@SuppressWarnings注解及调整Eclipse编译器设置来禁用与泛型类型相关的警告。具体步骤包括在代码中添加注解以及在Eclipse首选项中更改错误和警告设置。
1、使用注解@SuppressWarnings("unchecked")
2、设置Eclipse警告忽略
Window->Preferences->Java->Compiler->Errors/Warning->Generic types中将
Unchecked generic type operation(或者 Usage of a raw type)设置为Ignore
<!--StartFragment -->

被折叠的 条评论
为什么被折叠?