Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions


Answer : if iteration order is important - you should use for (for example if you want to iterate over collection backwards or just every second element of it), if iteration order is not important - use foreach. (Btw it is possible to use foreach also in cases where iteration order is important - in that case you need to re-construct collection. But this degrades program perfomance).. Hope I helped u..
1 5 1
For is used to describe support,favour,or the affect. Foreach there is no such word in British English.
0 0 0
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts