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

Java string question about favorite color. please help.

I'm on the second challenge and I can't believe I'm stuck. It says to fix the string for your favorite color. I fixed it this way. String favoriteColor = "Blue"; Can anyone tell me what I am doing wrong? from the previous video and what I did before this it should be right according to me, although it seems I'm wrong. Pleas help me! Thank you to whomever helps!

3 Answers

That's the correct answer as long as all you are spelling everything correctly and " and not 2(two) '. Copy this and it should get you past String favoriteColor = "blue" ;

I don't understand the " and not 2(two)'. Where would I put that line? I'm having the same problem Danny had and now I'm really confused.

Hey Deanna! This is simply a mix-up. I wasn't saying to use that as code but for him to be sure that he was using quotations and not 2(two) apostrophes. I hope this clears that up. Chances are if you are stuck here, it's probably a typo or a semi-colon left out.

If you don't get it sorted out, show me what you have and I'll try to work through it with you.

This is what I tried:

String favoriteColor = "blue";

That line of code doesn't work apparently. Is this Treehouse's problem on their end or am I doing something wrong?

Thank you.

Can you show me the whole code please?

I was stuck on this too early on, for some reason it happens to many people it seems. I would erase everything and re-type it in. Even the capitalization counts it seems, so make sure it is exactly as you see it letter for letter. I did it a few times and I could have swore I didn't change anything but I passed. So keep trying it but of course the good thing is Claude Garrett is here trying to help you as I was helped. :)

Thanks! I went back and did it again and I passed! I think I was being dyslexic for a moment and misspelled something every time lol. Well back to learning!

Anytime! I'm pretty much just getting started so I can't help with much but anytime you have a question I would love to try and help. I will only gain from trying to solve the problem.