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.

Java Java Objects (Retired) Harnessing the Power of Objects Incrementing

Thomas Wold
Thomas Wold
2,309 Points

I don't understand why this isn't working. Can someone plz explain. Java Objects Incrementing

I've been stuck on this challenge for awhile now. I've watched the video several times and just cant seem to understand what the errors are telling me or how to correct it. ./GoKart.java:17: error: cannot find symbol while (!isFullyCharged); ^ symbol: variable isFullyCharged location: class GoKart ./GoKart.java:18: error: cannot find symbol charge++; ^ symbol: variable charge location: class GoKart 2 errors

2 Answers

Hi there,

You're using the method isFullyCharged() - that requires the brackets:

  // do stuff

"Cannot find symbol" means you've used a variable name that you haven't defined or there's some other reason the compiler doesn't know what to do with a word you have written.

Can you post your code as there's another error in there about the ++ operator. I think you might have typed charge++ when you want to increment the value of mBarsCount, I think. That should be mBarsCount++;

I hope that helps !


Thomas Wold
Thomas Wold
2,309 Points

Thanks so much, I had forgotten the brackets as well as used charge++ instead of mBarsCount++.

No problem. Glad you got sorted! :-)