Treat Enumeration as Iterator

前端 未结 7 2395
感动是毒
感动是毒 2021-01-04 02:22

I have a class that implements the Enumeration interface, but Java\'s foreach loop requires the Iterator interface. Is there an <

7条回答
  •  醉酒成梦
    2021-01-04 02:58

    If you can modify the class then you can simply implement Iterator too and add the remove method..

提交回复
热议问题