Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Java Loops!
You have completed Java Loops!
Preview
Also known as the For Each Loop, it’s a simple way to process each item in a group without worrying about counters or indexes.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
through an entire set of things,
one by one,
0:00
without worrying about the details
of a conditional and a stopping point.
0:02
You provide a list of things,
and it goes through them all.
0:07
The loop is called the enhanced for loop,
or the for each loop.
0:11
The syntax is clean and simple,
but there's one small issue.
0:15
This loop will only work with something
that is iterable,
0:19
meaning it could be iterated over.
0:23
So it requires a group of values
of some kind, and since arrays
0:25
are likely in your near future,
I'll provide some of those for us to use.
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up