How can I make a copy of an iterator in Java?

前端 未结 3 1601
谎友^
谎友^ 2021-01-17 13:15

We have a list of elements and have a very simplistic collision detection where we check every object against every other object.

The check is commutative, so to avo

3条回答
  •  旧时难觅i
    2021-01-17 13:56

    You cannot copy Java iterators, so you'll have to do it without them:

    for(int i=0; i

提交回复
热议问题