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

Pricacy and Methods task

Hi Java helpers ,

Could you please check what wrong is in my code?

https://teamtreehouse.com/library/java-objects/meet-objects/privacy-and-methods-2

Thx mil

I can only see the following code:

public class GoKart {
  public String mColor = "red";
}

Could you paste your own code ?

public class GoKart { public String mColor = "red";

public String getColor() { return mColor; } }

No need help .. I passed my test thanks

1 Answer

The code you provided:

public class GoKart {
  public String mColor = "red";

  public String getColor() { 
    return mColor; 
  }
}

Is accepted on my computer. How about a restart of your browser or computer ? Perhaps that sounds lame but with me, that sometimes helps :)