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!
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
Robbie Moritz
1,665 PointsIllegal Argument Exceptions -- Java
I have been having trouble with this step in the Java course. I feel that I wrote my code the same way the instructor has his, but when I try to execute I get Pages of errors.
I do not know what I have done wrong, it might be simple like a misplaced set of curly braces. Here is the link to my code. https://w.trhou.se/ewr8tohxr2
Please help if you see the problem.

Robbie Moritz
1,665 PointsI turned the link into a snapshot. I hope that I can get some help with it.
1 Answer

Steve Hunter
57,709 PointsHI Robbie,
This isn't correct:
public void fill() {
fill(MAX_PEZ);
}
You're calling the method from inside itself. In this method you want to set pezCount
to be equal to MAX_PEZ
.
Try that and see if it clears your errors.
Steve.
Steve Hunter
57,709 PointsSteve Hunter
57,709 PointsThat link isn't working - can you re-post it?