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

Set the favorite color variable to your favorite color

Set the favorite color variable to your favorite color

Color.java
yourfavoriteColor String equals "";

3 Answers

Emil Rais
Emil Rais
26,873 Points

In Java you create variables according to the following syntax:

Type variableName = "value";

For example:

Number age = 23;

What am I suppose to write for favoritColor string equal " " ?

I had favoriteColor = "Gold" but it keeps saying I'm wrong

Emil Rais
Emil Rais
26,873 Points

"Gold" is of type String, so you need to make sure that you specify that. Don't forget the semi colon.

String favoriteColor = "Gold";

That should work well.

:) thank you