摘要:
在Iterator类中,我们经常用到两个方法: hasNext(), next(),具体含义: next(), 是返回当前元素, 并指向下一个元素。 hasNext(), 则是判断当前元素是否存在,并指向下一个元素(即所谓的索引)如: 枚举工号 Map map = new HashMap(); map = new HashMap(); map.put("1155669", "Tom"); map.put("1155689", "Jane"); map.put("1165669", "K 阅读全文