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) 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); }