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 Arrays!
You have completed Java Arrays!
Preview
Let's explore the compound expression for loop from yesteryear.
Copy and Paste
int[] briansScoreCard = {1, 2, 1, 5, 2, 4, 4, 4, 3, 6, 1, 2, 5, 4, 3, 2, 6, 3};
Resources
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
The Enhanced For Loop
is the way that you, as a Java developer,
0:00
are encouraged to loop over an iterable,
an object that can be iterated on.
0:03
It was released in 2004,
so it's been around
0:07
for quite a while now
and is considered standard.
0:10
Before that, Java encouraged you
to use the standard For Loop.
0:13
That's because for loops are ideal to use
when you know how many times
0:17
you want your code to execute.
0:20
Arrays are great for this, right?
0:22
We know how many elements
are in the array,
0:24
and we can access the elements
easily by their index.
0:27
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