除了基础类型外都可以
List< String >
List< Runnable >
List< TimeUnit >
List< Comparable >
List< int[] >
List< Object[] >
List< Callable<String> >
List< Map.Entry<?,?> >
泛型方法也是一样
Collections.< int >emptyList();
Collections.< String >emptyList();
Collections.< Runnable >emptyList();
Collections.< TimeUnit >emptyList();
Collections.< Comparable >emptyList();
Collections.< int[] >emptyList();
Collections.< Object[] >emptyList();
Collections.< Callable<String> >emptyList();
Collections.< Map.Entry<?,?> >emptyList();
参考:
http://www.angelikalanger.com/GenericsFAQ/FAQSections/TypeArguments.html#Which%20types%20are%20permitted%20as%20type%20arguments?
2352




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



