KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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 avoid repeating it twice, we would do this in C++: for (list<Object>::iterator it0 = list.begin(); it0 != list.end(); ++it0) { for (list<Object>::iterator it1 = it0; it1 != list.end(); ++it1) { Test(*it0, *it1); } } The key bit here is the copy it1 = it0 How would you write this in Java?
Tags (comma-separated)
Save Edits
Cancel