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 how to set and retrieve items from an array.
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
Normally you can do that
by just using the up arrow.
0:00
Let's go ahead and practice
building our friends array all over again.
0:00
I want to say the type is a string array
0:05
named friends.
0:07
And I want a new string array
0:10
with three elements, right?
0:11
And there we go.
0:15
We have an array with each element
set to the type's default value.
0:16
And we want to set this
0:20
first value here, this first null,
we want to set that to Brian.
0:21
So the way to access
an element of an array is by using
0:25
what is known as an index.
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