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

Coding the Fun Facts - Using an array (challenge)

Hey guys im stuck on this challenge, got my self mixed up.. any ideas how to pass the second step? any ideas? maybe somone could show me how the correct version should look like?

Array.java
String[] sports = { "Basketball", "Baseball", "Tennis" };
String bestSport = ("Basketball
                    int numberOfSports = int sports(sports.lenght);

I don't understand the second line of your code snippet. What are you even trying to do here??

String bestSport = ("Basketball int numberOfSports = int sports(sports.lenght);

Did you mix up two lines into one? for e.g. if I wanna take a guess,

You might be trying to write: String bestSport = "Basketball" OR String bestSport = new String ("Basketball"); And then the second line might be... int numberOfSports = sports.length;

i don't know man what your question is.

Erm sorry i though question will be included. first question was : "Declare a String variable named bestSport and initialize it to the first element of the sports array". 1) so i wrote code String bestSport = ("Basketball"); [propably deleted some of the code before i asked question, dont know why it appeared [("Basketball] like that.

I actually have to say sorry, just tried it now, and everything seems fine, propably i mixed myself up with something...

Thanks Sanat !