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
Max Reinsch
5,740 PointsWhat is a load method?
Like in the Methods and Constants video?
public void load() {
mPezCount = MAX_PEZ;
}
1 Answer
Tom Lawrence
8,685 PointsThis method is setting the value of mPezCount to that of MAX_PEZ, that is basically is doing here is filling the pez up fully by setting the mPezCount (what it currently is holding), to that of whatever the maximum is which was set as a constant in MAX_PEZ.
Max Reinsch
5,740 PointsMax Reinsch
5,740 PointsThank you!