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 trialJoshua De La Rosa
2,721 PointsConfused on last quiz question i dont know how to setup the getColor method for my System.out,printf
GoKart mColor = new GoKart ("Red"); System.out.printf("%s");
Dont know what to setup beyond this?
4 Answers
Craig Dennis
Treehouse TeacherThe getColor
method was created in the previous code challenge.
This is looking for you to just call it.
HINT: Something like this:
SomeObject something = new SomeObject();
System.out.printf("The result from the method is %s", something.getSomethingElse());
Trevor Willis
597 PointsI sat there for 30 minutes trying to figure out what I did wrong, only to realize I used "println" instead of "printf". If you're having a similar problem, double check that.
Craig Dennis
Treehouse TeacherCall your method getColor
as the second param to printf
Joshua De La Rosa
2,721 PointsPlease show me the code to create the get color method. I have tried time and time agin there is something im not getting
David Rosenman
541 PointsI think there is a bug in the quiz. When I typed in what should have been marked as correct...
public class GoKart {
private String getColor = "red";
public String getColor() {
return getColor;
}
}
... The message "Bummer! The method name should match more or less your field name. Expected getolor" So I had to change getColor to getolor to get credit.
public class GoKart {
private String getolor = "red";
public String getColor() {
return getolor;
}
}
...and this ^^^ was counted as being correct. I logged into the quiz again to see if the same mistake came up and what came up was 'Bummer! The method name should match more or less your field name. Expected getetColor.
So I changed getColor to getetColor and what came up this time was ...'expected getetetColor'... so I changed it to getetetColor and then it wanted getetetetColor lol.
Danilo Granado
Courses Plus Student 7,026 PointsI`m having the same problem
Kevin Frostad
3,483 PointsAgreed. They should fix that. Method names should not conflict with variable names.
Joshua De La Rosa
2,721 PointsJoshua De La Rosa
2,721 Pointsholy jimminy christmas i did it thank you very much craig you were very helpful. I also understand the code much clearer.
Craig Dennis
Treehouse TeacherCraig Dennis
Treehouse TeacherYou are very welcome! Glad it clicked!