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) Getting Started with Android Troubleshooting Java

not working, Im writing out string, then favorite color = sign quotes, red then ; and its wrong, why?

I included code from previous task because it tells me to do so and then I added new code for color and it's wrong, don't know why. I also just typed in string, favorite color = sign, quotation marks with color red inside quote marks and then ; and its still showing as wrong. Is it because Im working on a Mac laptop?

Color.java
String myName = "Jesse";
String favoritecolor = "red";

1 Answer

Stone Preston
Stone Preston
42,016 Points

the task states: Set the favoriteColor variable to your favorite color. You might need to move some things around and add or change some text.

you dont need the myName variable, the task did not ask you to provide that so you can remove that line

the reason its not working is you named the variable favoritecolor instead of favoriteColor. variable names in java use camel case and start with a lower case letter: thisIsAVariableName

use the name the task asked for:

String favoriteColor = "red";

Thank you Stone, it worked