0

What is a foreach loop and how does it work?

My IDE often suggests me to use a foreach loop instead of a normal for loop, so what does it do?

1st Jul 2017, 5:44 AM
Jonas Schröter
Jonas Schröter - avatar
7 RĂ©ponses
0
Thank you, but it's named foreach
1st Jul 2017, 7:16 AM
Jonas Schröter
Jonas Schröter - avatar
0
Sorry, the IDE suggests foreach, but when I take the suggestion, it just writes a for loop, so that's solved. Thank you!
1st Jul 2017, 7:23 AM
Jonas Schröter
Jonas Schröter - avatar
0
Yes I am, thanks I don't need help anymore, it was a misunderstanding. I'm using Intellij Idea or Eclipse.
1st Jul 2017, 10:50 AM
Jonas Schröter
Jonas Schröter - avatar
0
It does. If I write for, it suggests foreach, but it writes a special for loop, so everything is fine.
1st Jul 2017, 11:55 AM
Jonas Schröter
Jonas Schröter - avatar