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

How do I complete the challenge task 'Initialize the sports array with three names of sports.'

Hi

I am having complete the code challenge titled

'Declare an array of Strings named sports. Initialize the sports array with three names of sports. Use the curly brace syntax we learned in the video.

I am assuming the answer to be

String[] sports = { "baseball", "soccer, "Tennis" };

Am I doing something wrong?

Thanks in advance! Eugene

2 Answers

String[] sports = {"football","golf","baseball",};

Hi Eugene I Just finished this my self and the only thing I could see is that you didn't place the coma after your last word. However That shouldn't make a difference due to the fact that you are at the end of the line in the first place. Actually I'am kinda perplex to be honest test out the code I put in my comment and see if it works for yeah.

Keep up the Good Work Todd(aka the fox)

Hey Thanks a lot Todd! It works! Appreciate it! :)

No Problem Eugene Glad I could help !