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 trialVictor Ramirez
191 PointsStuck on this part...
Can't get this right, need help on this.
favoriteColor String equals "";
1 Answer
Harry James
14,780 PointsHey Victor! Welcome to the Treehouse Community!
In Java/Android, we start a variable declaration with the type of object it is, followed by its name.
On the declaration side, we don't actually use the keyword equals, instead we use the equals symbol itself =
followed by the value (You can have anything for this - whatever your favorite color is!). Finally, we finish the line off with a semicolon, which has already been done for you.
Also, I highly recommend you take a look at the Java Track. Android uses the Java language so if you get stuck with these concepts, the track will certainly help you understand them! If that's a bit much to learn and you want to get into Android quickly, I would at least recommend looking at the Java Basics course.
Hopefully this information should help you get through the challenge but if you get stuck along the way, let me know. Also, if you have any further questions, you can either leave them in the Comments here or tag me on the forums with @Harry James
:)