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 Build a Simple Android App (2014) Coding the Fun Facts Using an Array

Moises Miguel
Moises Miguel
5,028 Points

Declare 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.

Array.java
String[] sports = { "Basketball", "Baseball", "Tennis" };
String bestSports = sports[0];

2 Answers

Chase Marchione
Chase Marchione
155,055 Points

You'll want to drop the s from the end of 'bestSports', my friend (bestSport should be the name of your string.)

Harry James
Harry James
14,780 Points

Hey 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!