Difference between Java Enumeration and Iterator

后端 未结 10 1793
庸人自扰
庸人自扰 2020-11-27 09:47

What is the exact difference between these two interfaces? Does Enumeration have benefits over using Iterator? If anyone could elaborate, a reference article would be appre

10条回答
  •  清酒与你
    2020-11-27 10:23

    One simple fact but haven't mentioned in previous answers is that Iterator is used with Iterable to serve in interpreting for(_type_ element:collection){...} structure.

提交回复
热议问题