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 trialBen Schaal
Courses Plus Student 408 PointsAdd a public method, or getter, that can be used to get the color of the go kart. Why am i getting an error?
I do not understand why i keep getting a syntax error. I've looked at other forum posts and have written out the code exactly like the have and still having issues.
public class GoKart {
private String mColor = "red";
public GoKart(String color){
mColor = color;
}
public String getColor(){
return mColor;
}
}
3 Answers
Ben Schaal
Courses Plus Student 408 PointsWell the answer o had was the one for the next challenge. Mir kept giving me an error saying I needed another string.
Ben Schaal
Courses Plus Student 408 PointsEnded up figuring out my mistake after re-watching the video. thanks for the response though.
Craig Dennis
Treehouse TeacherWhat was the problem?
Ben Schaal
Courses Plus Student 408 PointsI had the answer for the next challenge. Sorry about the delay in response. I thought it sent before but I guess it didn't.