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 trial4 Answers
Peter Price
4,007 PointsHi Shane,
In an array you use brackets [] not parenthesis (). So the answer is:
String[] sports = { "Basketball", "Baseball", "Tennis" };
String bestSport = sports [0];
If it doesn't work just say.
Shane Emery
398 PointsOh dude, that did it. Thank you very much, both of you.
Peter Price
4,007 PointsCan we see your best shot at the answer so far?
emmanuel medina
2,691 PointsMaybe String bestSports = Sports[0];
Shane Emery
398 PointsNope, didn't work. :/
Peter Price
4,007 PointsNo problem Shane, glad I could help.
Shane Emery
398 PointsShane Emery
398 PointsI had something along the lines of -
String[] = sports ("Basketball, Baseball, Tennis");
String bestSports = Sports ("0");
I don't think I'm really close to being right, but I am confused :L
Any help would be much appreciated.