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

Julie Austin
Julie Austin
1,322 Points

How to check barCount?

So I'm doing the exercise where we set the GoKart to fill with MAX_BARS which I did but now the exercise is asking me to create a private field called barCount that tracks how many bars the GoKart currently has but you DID NOT teach this! You only showed how to fill the bar count!

Can you provide a link to the video?

Julie Austin
Julie Austin
1,322 Points

This is the link to the video right before the barCount assignment.

https://teamtreehouse.com/library/filling-the-dispenser

1 Answer

What you are being asked to do is very similar to the video. But instead of MAX_PEZ, pezCount and fill() you will be using MAX_BARS, barCount and charge() Creating the private field is at the very being of the video and is done by declaring:

private int pezCount;

For the challenge you will have:

private int barCount;