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

i dont understand

i don't know what to do i did exactly what i needed to do

Color.java
 String blue equals "favoritecolor";

3 Answers

Emil Rais
Emil Rais
26,873 Points

Now I'm not aware of the context, so I might be wrong, but if that's plain Java, then the following is up: String blue equals "favoritecolor"; is syntactically invalid Java.

What you're most likely after is a string "blue", and you want to examine whether it is equal to a variable called favoriteColor. Am I right? If that is the case you'll be after something like: "blue".equals(favoriteColor).

Sky Lu
Sky Lu
419 Points

I just tested, this one sure can success: String favoriteColor = "Blue";

Sky Lu
Sky Lu
419 Points

The answer is string my favouritecolor = "blue"

Emil Rais
Emil Rais
26,873 Points

This is not syntactically correct.

If it is a variable declaration the type should have its first letter capitalized: String my favouritecolor = "blue". (Still invalid)

Spaces are not allowed in variable names and generally we camel case variable names in Java: String myFavouriteColor = "blue". (This is valid)