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 trialKyudong Lim
528 PointsHelp. task 2 of 2
And the prompt is : Now change the color field to be private by adding the access level modifier.
samuel zaffran
24,815 PointsOk, so we want that that the color field become private. What is the color field ? It's the line : public String mColor = "red"; But right now this color field is public... You just have to change that ! Luck.
1 Answer
samuel zaffran
24,815 PointsHi, We want that the color field being private, all you need to do is to reevaluate the access level modifier. After you created your method to get the color wich is public, you have to think how do i privatise the red color ? Can't tell you more :) Luck
Kyudong Lim
528 PointsKyudong Lim
528 Pointsthis is the code i have so far : public class GoKart { public String mColor = "red"; public String getColor(){ return mColor;}}