日期:2014-05-20  浏览次数:20546 次

菜鸟学习中遇到的代码看不懂了,求解~~~~~~~~
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不久明白了吗?