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 (retired 2014) Getting Started with Android Java Variables Explained

Salvis Are
Salvis Are
1,018 Points

Favorite Color String?

Hi,

My command of string favorite color is the following: String favoriteColor = "green";

Probably it is something obvious that there is some kind of mistake in the code, only I am not able to figure it out..

Has anyone else got the same problem?

Thanks, Salvis.

4 Answers

Stone Preston
Stone Preston
42,016 Points

I pasted your code

String favoriteColor = "green";

into the challenge engine and passed just fine

Salvis Are
Salvis Are
1,018 Points

Hmmm,

The challenge engine tells me this: JavaTester.java:19: ';' expected favoriteColor String equals ""; ^ JavaTester.java:19: not a statement favoriteColor String equals ""; ^ JavaTester.java:19: ';' expected favoriteColor String equals ""; ^ 3 errors

Stone Preston
Stone Preston
42,016 Points

hmm id start the challenge over and try again. click here to be taken to the challenge again and try one more time.

Salvis Are
Salvis Are
1,018 Points

Thanks Stone,

This seemed to work now!

Stone Preston
Stone Preston
42,016 Points

glad you got it figured out

to cahnge a color in java string

string favoriteColor ="purple"; String purple ="blue";