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 Java Objects (Retired) Harnessing the Power of Objects Helper Methods and Conditionals

Pauliina K
Pauliina K
1,973 Points

Helper methods

So, I've watched this video three times now and I understand everything that is talked about, but I can't seem to understand what a helper method actually is. When is it showed in the video? How do you make one? Craig never says what in this video the helper method is. So now that I'm at the challenge, I don't know what to do. We did a bunch of stuff in this video, I just don't understand which one was a helper method?

1 Answer

Hi Pauliina,

The helper method you created was isEmpty(). These methods are built into a class to perform simple tasks and checks easily. So, checking whether the dispenser is empty, or not, is a task that is likely to be required quite often. Rather than accessing the member variables to test if they equal zero, and repeating that code every time the check is required, a method is written. That way, you always have easy access to the test of emptiness. That 'helps' you use the class.

Make sense?

Steve.