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 trial

Java

Chris 16
Chris 16
623 Points

Add a getter method

I know Im close but iM not quite getting it, it is rather frustrating that these challenges stop our progress period, if I was using Udemy , I can keep practicing and learning, this slows me down

GoKart { String color = "red"; public String getColor() { return color;

3 Answers

John Sns
John Sns
4,173 Points
class GoKart{
    String color;//or String color = "red";
    public String getColor(){
         return color;
   }
}

Your answer seems correct to me, unless you didn't add the correct braces'{}'.

David Hinton
David Hinton
3,070 Points

Think I fixed it with this

resultsTxt.setText(Integer.toString(answer));

I posted this in the wrong discussion and it wont let me delete

Chris 16
Chris 16
623 Points

Yes, that was the problem. I guess we cant except replies over the weekend. But that was my error not adding one curly bracket. I also thought we were prevented by the challenge from continuing the course, Im glad I was also wrong there. Thank you

This course so far is well designed to build upon itself so that the videos do prepare us for the challenges as it should.