Enumeration是遍历集合元素的一种方法。
Enumeration中只有两个方法:
1.hasMoreElements()
测试此枚举是否包含更多的元素。
2.nextElement()
如果此枚举对象至少还有一个可提供的元素,则返回此枚举的下一个元素。
使用举例:
Enumeration<String> paraNames = request.getHeaderNames();
for(Enumeration e=paraNames;e.hasMoreElements();){
String thisName = e.nextElement().toString();
String thisValue = request.getHeader(thisName);
System.out.println(thisName+"--------------"+thisValue);
}