Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Stacy Chambers
1,179 PointsFor loops
There is a certain kind of for loop that is being used in Implement Chooser UI video. Is there anyone that can explain the type of for loop?
for (String option : options)
2 Answers
Fahad Mutair
10,359 Pointshi Stacy Chambers , this is For-each loop or enhanced For
Syntax of for-each loop:
for(data_type variable : array | collection){}
data_type : like String, double , int , etc.
variable : name it as you like.
array | collection: need array, List, Set, Map etc.
Stacy Chambers
1,179 PointsThank you so Much!
