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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![hamdan hassan](https://secure.gravatar.com/avatar/e480c932272ac8f295ac2158a375dc9f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
hamdan hassan
Courses Plus Student 640 Pointscan someone explain this
public void fill(){ fill(MAX_PEZ); }
This method does not accept any parameter so how fill(MAX_PEZ)
2 Answers
![Livia Galeazzi](https://uploads.teamtreehouse.com/production/profile-photos/7058122/micro_Go_board_part.jpg)
Livia Galeazzi
Java Web Development Techdegree Graduate 21,083 PointsThere should be two "fill" methods. The one you talk about which does not take a parameter, and a second one which does take a parameter.
public void fill(int pezAmount) {
pezCount += pezAmount;
}
The fill() method calls the fill(int pezAmount) method. They have the same name but are different. It's called method overloading.
I recommend you watch the video once more as it's a pretty important concept.
![Bogdan Siverchuk](https://uploads.teamtreehouse.com/production/profile-photos/9670882/micro_h1.jpg)
Bogdan Siverchuk
Courses Plus Student 1,707 Pointsmaking default values! we connecting two methods, which are doing basically the same thing. But the buaty in it that if we do changes in fill (paremeters) we don't need to do any changes to fill()! one fill is for action, and the second is for math! I hope it helped! Never give up!