Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Kern Tallett
10,012 PointsPlease make the field Public: I can't see where I have gone wrong. Any help is much appreciated.
I am getting an incorrect with a please make the mBatteryCount public. I thought I had made it accessible yet not changeable. I can't see the error I am making.
public class GoKart {
public static final int MAX_BATTERY = 8;
private String mColor;
private int mBatteryCount;
public GoKart(String color) {
mColor = color;
mBatteryCount = 0;
}
public void load() {
mBatteryCount = MAX_BATTERY;
}
public String getColor() {
return mColor;
}
}
1 Answer

Dan Johnson
40,532 PointsThe challenge is confused about the names you're using. mBatteryCount should be mBarsCount and the method load should be charge.
The actual logic looks fine though, so that should be all you need to change.
Kern Tallett
10,012 PointsKern Tallett
10,012 PointsThanks Dan. It worked, I followed what I learned from the pez example too closely and ignored the possibility other areas may need a change.