public static <T> List<T> listAndCast(Query query) {
@SuppressWarnings("unchecked")
List<T> list = query.list();
return list;
}
Run Code Online (Sandbox Code Playgroud)
在以下行中:
public static <T> List<T> listAndCast(Query query) {
Run Code Online (Sandbox Code Playgroud)
我们为什么需要<T>
?
归档时间: |
|
查看次数: |
189 次 |
最近记录: |