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 thinki am doing it right, but for some reason the computer keeps telling me i am doing it wrong, help please

builid a simple android app, its saying that i am doing something wrong when i really think i am getting right this is holding me back from my free trial, please help

Color.java
String FavoritColor=blue
  "";
Zaw Mai
Zaw Mai
1,605 Points

Hi Rodrigo, the program does not recognize blue because it is not between the "" quotation marks. For initializing string data type in Java, you have to insert the value between "", In this case, it will be String FavoriteColor = "blue";

2 Answers

The intention of the challenge is to create a string variable that holds the string value of your favorite color.

The starting position is:

favoriteColor String equals "";

which isn't correct, obviously - that's why this is a challenge.

First we need to state that the variable being declared is a string and then give the variable a name. The challenge suggests we call it favoriteColor. We then need to assign a value to it or which we use the 'equals' sign, =. After that we need to state what the favorite color is and surround that with inverted commas, implying that the value is a string. You chose "blue". All that needs ending with a semicolon.

That all looks like:

String favoriteColor = "blue";

I hope that helps.

Steve.

Devin Scheu
Devin Scheu
66,191 Points

Hey, your code should look like this:

String favoriteColor = "blue";