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 trialsatish singla
906 PointsNot able to answer challenge
I am no able to solve the challenge for this video. Please help.
2 Answers
Khaleel Hamid
5,258 PointsWhat is the question?
Gloria Dwomoh
13,116 PointsThe first challenge asks...
"Declare a String variable named bestSport and initialize it to the first element of the sports array."
so
- Declare a string named bestSport... (How do we declare a string? We declare a string like this ex. String name; )
- Initialize it to the first element of the sport array (How do we initialize something to an array? Lets say we have an array called... people[3] be initialize our previous string to an element in it like this ex. name = people[2]; )
Now all together in one line...
String name = people [2]; //initializing to the 3rd element of the array
my example shows how to solve the 1st task (it is not the exact solution but it is very close to the exact solution). So try to understand it and try the task again.