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

Im stuck at: Declare a String variable named bestSport and initialize it to the first element of the sports array. help!

it says: Declare a String variable named bestSport and initialize it to the first element of the sports array.

and all I get is: String[] sports = { "basketball", "baseball', "football" };

please help !

3 Answers

String[] sports = { "Basketball", "Baseball", "Tennis" };

String bestSport = sports[0];

Thanks a lot !! I was misspelling the second part of the code.

not a problem yea i think we have all been there lol especially when you have been working on courses all day.

This is true !