Skip to main content
2 of 3
added 26 characters in body; edited tags; edited title
user avatar
user avatar

How should I decide to use an array or an iterator to implement a loop?

I am making a frequent use of Java's ArrayList (for enemies, coins, and bullets), but I'm wondering if there are any better containers or utilities for doing this. I'm processing the elements in a for loop, but I could also use an iterator; how should I go about deciding which is better for my game from a performance perspective?

Vicky
  • 21
  • 1
  • 5