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

dunno what to do

I don't get what they want me to do here, don't give me the answer, but can someone explain what they want here? Thanks!

2 Answers

Durim Kryeziu
Durim Kryeziu
14,002 Points

Hi Pixel HD,

So please read again the Example.java file after reading my answer :)

They want from you to create another method (wisely, because the topic is about refactoring, be careful DRY pattern ;) ) that allows others to be able to add an item using just addItem(itemHere) which means add 1 itemHere on the cart

Hope it helps! If not, just let me know, I'll answer the challenge and explain to you why you should do it that way :)

Ohh I get thanks.

Seth Kroger
Seth Kroger
56,403 Points

They're asking you to add a second method to the ShoppingCart class. The method's name, which you should see in the commented out code in main() has the same name as the first, but with a different list of arguments.

oh ok.