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 trialHannah Yarbrough
575 PointsString [] sports = { "bestSport", "Basketball", "Baseball", "Tennis" }; Is "bestSport" declared first in this code?
My goal is to declare "bestSports" as the first variable in this array. Does this look right to you? I'm unable to move forward
String [] sports = { "bestSport", "Basketball", "Baseball", "Tennis" };
3 Answers
Caleb Kleveter
Treehouse Moderator 37,862 PointsThe issue might be that it is 'bestSport', not 'bestSports'. Is that it?
Caleb Kleveter
Treehouse Moderator 37,862 PointsI got it!
You create an empty string:
String bestSport;
Then assign it to the first string in the sports array:
bestSport = sports[0];
Caleb Kleveter
Treehouse Moderator 37,862 PointsOr I think you could do it all in one line:
String bestSport = sports[0];
Hannah Yarbrough
575 PointsHannah Yarbrough
575 PointsNo, that didn't help. I figured out how to move on with the course. I hate leaving the challenge unanswered but I have to move on :)