Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Objects (Retired) Delivering the MVP Defaulting Parameters

Help with this challenge, please?

Hello, I keep running into issues with this challenge saying I hadn't commented out the last line in Example, which i have. When view the Preview, it seems to pass, yet the comment error keeps appearing. Any help would be much appreciated! Thank you!

2 Answers

Daniel Vigil
Daniel Vigil
26,473 Points

The issue may be in your overloaded method. I came across the same issue and fixed it by calling the method that is there within the new method. try putting in a quantity variable within the new method and pass it to the already set up add to cart method.

Roland Kalmogo
Roland Kalmogo
25,657 Points

just uncomment the code and go to ShoppingCart.java to surcharge addItem() method. It'll look like public void addItem(Product item){ addItem(item,1); }