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

Android Build a Simple Android App (2014) Coding the Fun Facts Properties of Arrays

Josh Myers
Josh Myers
3,203 Points

Next code challenge question

Hi,

For some reason it wouldn't let me ask a question about the next code challenge on the next page...so I'll just post it here. I'm not sure what it means when it asks me to "initialize it to the first element of the sports array"...

I'm just a little confused on how to work it out.

1 Answer

Logan R
Logan R
22,989 Points

When it says initialize, that means when you first make the array.

int[] intarray = {12, 54, 58};

The above was initialized with the values 12, 54, 58. So when it asks you to initialize an array named sports with 3 sports, it wants you to create a string array named sports and in the declaration method, add 3 sports (Strings) to the array.

If this is still kinda unclear, rewatch the video just before the challenge. he codes the array at 56 seconds in.

Hope this helps!