当前位置: 代码迷 >> J2SE >> 初学者学习中遇到的代码看不懂了,求解~
  详细解决方案

初学者学习中遇到的代码看不懂了,求解~

热度:97   发布时间:2016-04-23 22:28:17.0
菜鸟学习中遇到的代码看不懂了,求解~~~~~~~~
ArrayList<FileInputStream> al = new ArrayList<FileInputStream>(); 
for(int x=1; x<=3; x++)

al.add(new FileInputStream(x+".txt")); 

Enumeration<FileInputStream> en = Collections.enumeration(al);
/*
最后一句collections.enumeration(a1)是什么意思。。
*/
enumeration

------解决方案--------------------
public static <T> Enumeration<T> enumeration(Collection<T> c)返回一个指定 collection 上的枚举。此方法提供与遗留 API 的互操作性,遗留 API 需要一个枚举作为输入。 

参数:
c - 将返回其枚举的 collection。 
返回:
指定 collection 上的一个枚举。


------解决方案--------------------
list转enum
------解决方案--------------------
查api不久明白了吗?
  相关解决方案