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 trialVidmantas Varnas
5,215 PointsProblems with task
Hello i have problems passing this, it always show me the bug that first part of the test is not passing, but the code looks fine :)
class GoKart {
private String this.color = "red";
public Gokart(String color){
private String color;
this.color = color;
}
public String getColor() {
return color;
}
}
2 Answers
Aaron Goodrum
9,660 Pointsthe this.color is getting set in the [public Gokart(String color)] for color.
there no need to make a other [private String color;] and you can't call [private String this.color = "red";] on its self.
class GoKart {
private String color;
public Gokart(String color){
this.color = color;
}
public String getColor() {
return color;
}
}
Vidmantas Varnas
5,215 PointsThank you !
Vidmantas Varnas
5,215 PointsVidmantas Varnas
5,215 PointsThank You !