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 trialMoises Miguel
5,028 PointsDeclare a String variable named bestSport and initialize it to the first element of the sports array.
Hey guys I am just having some issues setting the string to declare the array.
String[] sports = { "Basketball", "Baseball", "Tennis" };
String bestSports = sports[0];
2 Answers
Chase Marchione
155,055 PointsYou'll want to drop the s from the end of 'bestSports', my friend (bestSport should be the name of your string.)
Moises Miguel
5,028 PointsWoops thanks !
Harry James
14,780 PointsHey Moises!
If this question has been answered, go ahead and mark CJ's answer as the Best Answer. It lets other forum users know that this question has been answered and CJ will be credited for his answer, too!